我有一个javascript函数showHide(shID),它是一个隐藏div并在点击“read more”后显示内容的函数。这里是我的小提琴:FiddleJQuery Cookie不起作用
在将JQuery Cookie添加到此函数后,它看起来像函数showHide(shID)消失了,任何人都可以帮我修复它吗?谢谢我真的需要帮助。这里我的小提琴:Fiddle
我需要这样做smtg:首先点击“readmore”,隐藏内容会显示,设置cookie和用户回来后访问我的页面隐藏的内容仍然显示。
<div id="wrap">
<a href="#" id="example-show" class="showLink" onclick="showHide('example');">
<button class="btn-u btn-u-lg btn-block btn-u-dark-orange">
Read More
</button>
</a>
<div id="example" class="more">
<iframe width="600" height="315" src="//www.youtube.com/embed/BaPlMMlyM_0" frameborder="0" allowfullscreen></iframe>
<p>Congratulations! You've found the magic hidden text! Clicking the link below will hide this content again.</p>
</div>
</div>
JQuery的饼干 - 这是插入。你需要单独包括它。纠正我,如果我错了 – demo 2015-02-05 14:23:12
嗨演示,谢谢你回复我,我也不太确定,我第一次使用JQuery cookie – lucas 2015-02-05 14:38:53
请看这个http://plugins.jquery.com/cookie/我认为你需要下载并添加库到项目 – demo 2015-02-05 14:41:47