` it opens the hidden `` below it. That's great - works as expected. However when a user clicks back on the same `` - it closes the `` and reopens it instantly.
I need the `` to stay closed. I also need the remaining functionality to stay in place.
This is my jQuery:
$(document).ready(function() {
$('div#winners-table div').hide();
$('div#winners-table h4').click(function(){
$('div#winners-table h4.open').each(function() {
$(this).attr('class', 'closed');
$(this).siblings('div').slideUp();
});
$(this).toggleClass('open');
$(this).siblings('div').slideToggle();
});
});
**EDIT**
This is my HTML:
...
-
...
...
-
...
...
-
...
...
-
...
...
Could you clarify your desired behavior concerning the closed
class? Should every closed h4
have it, or just the last clicked h4
?以上就是jQuery click function and slideToggle的详细内容,更多请关注web前端其它相关文章!
相关文章
评论
抢沙发
前端开发相关广告投放 更专业 更精准
联系我们觉得文章有用就打赏一下文章作者
支付宝扫一扫打赏

微信扫一扫打赏

` - it closes the `` and reopens it instantly.
I need the `` to stay closed. I also need the remaining functionality to stay in place.
This is my jQuery:
$(document).ready(function() {
$('div#winners-table div').hide();
$('div#winners-table h4').click(function(){
$('div#winners-table h4.open').each(function() {
$(this).attr('class', 'closed');
$(this).siblings('div').slideUp();
});
$(this).toggleClass('open');
$(this).siblings('div').slideToggle();
});
});
**EDIT**
This is my HTML:
...
-
...
...
-
...
...
-
...
...
-
...
...
Could you clarify your desired behavior concerning the closed
class? Should every closed h4
have it, or just the last clicked h4
?以上就是jQuery click function and slideToggle的详细内容,更多请关注web前端其它相关文章!
相关文章
评论
抢沙发
前端开发相关广告投放 更专业 更精准
联系我们觉得文章有用就打赏一下文章作者
支付宝扫一扫打赏

微信扫一扫打赏

` to stay closed. I also need the remaining functionality to stay in place.
This is my jQuery:
$(document).ready(function() {
$('div#winners-table div').hide();
$('div#winners-table h4').click(function(){
$('div#winners-table h4.open').each(function() {
$(this).attr('class', 'closed');
$(this).siblings('div').slideUp();
});
$(this).toggleClass('open');
$(this).siblings('div').slideToggle();
});
});
**EDIT**
This is my HTML:
Could you clarify your desired behavior concerning the
...
-
...
... -
...
... -
...
... -
...
...
Could you clarify your desired behavior concerning the
closed
class? Should every closed h4
have it, or just the last clicked h4
?以上就是jQuery click function and slideToggle的详细内容,更多请关注web前端其它相关文章!
相关文章
评论 抢沙发
前端开发相关广告投放 更专业 更精准
联系我们觉得文章有用就打赏一下文章作者
支付宝扫一扫打赏

微信扫一扫打赏
