简体   繁体   English

更改配方成分以适应变化

[英]Change recipe ingredients as serving changes

i am working on a recipe site (which is almost finished except this problem) on a single recipe page, i have recipe serving input field and recipe ingredients. 我正在单个食谱页面上的食谱站点(除此问题外几乎已完成)上工作,我有食谱服务于输入字段和食谱成分。

My question is that using jquery i want to change recipe ingredients dynamically if the serving changes 我的问题是,使用jquery时,如果服务发生变化,我想动态更改配方成分

i have seen a similar closed threat, but it did not help me my exact code will look like this 我已经看到过类似的封闭威胁,但它并没有帮助我,我的确切代码将如下所示

            Serving: <input type="text" name="serving" class="serving" value="5"/> persons 

            <h3>ingredients</h3>
            <ul class="ingredients">
            <li class="ingredient">
            <span class="amount">1</span> cups
            <span class="name"><a href="http://www.mysite.com/ingredient/yogurt/">yogurt</a></span> 
            </li>

            <li class="ingredient">
            <span class="amount">2</span> tbsp
            <span class="name"><a href="http://www.mysite.com/ingredient/yogurt/">chillies</a></span> 
            </li>

            <li class="ingredient">
            <span class="amount">3</span> pieces
            <span class="name"><a href="http://www.mysite.com/ingredient/yogurt/">butter</a></span> 
            </li>
            </ul>

i would highly appreciate any help on this to get me finish my pending site 我非常感谢您提供的任何帮助,以帮助我完成待审核的网站

Regards 问候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM