[英]Toggling a div with jquery
I would like for the div #share-sub-bottom
to be toggled between shown and hidden when the user clicks the add photo link. 我希望当用户单击添加照片链接时,在显示和隐藏之间切换div
#share-sub-bottom
。 For some reason, I cannot get it to work, what could I be doing wrong? 由于某种原因,我无法使它正常工作,我可能做错了什么?
Jsfiddle Demo http://jsfiddle.net/Jzp5H/1/ Jsfiddle演示http://jsfiddle.net/Jzp5H/1/
remove the dot from your class definition, and it works like charm 从您的类定义中删除点,它就像魅力
this you have 这个你有
<p> <a href="#" class=".show_hide"> Add Photo </a> </p>
this you should have 这个你应该有
<p> <a href="#" class="show_hide"> Add Photo </a> </p>
Hi now demo http://jsfiddle.net/Jzp5H/8/ 嗨,现在演示http://jsfiddle.net/Jzp5H/8/
<a href="#" class=".show_hide"> Add Photo </a>
into this 进入这个
<a href="#" class="show_hide"> Add Photo </a>
Do not use a dot in front class=".show_hide"
used simply class="show_hide"
请勿在前面的
class=".show_hide"
仅使用class="show_hide"
Change in your html file for this line: 在您的html文件中更改以下内容:
<a href="#" class=".show_hide"> Add Photo </a>
To this: 对此:
<a href="#" class="show_hide"> Add Photo </a>
Don't use dot(.) in front. 不要在前面使用dot(。)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.