我在删除一个简单的关闭div id按钮的jquery幻灯片效果时遇到了一些麻烦。
我只是想轻弹关闭-没有动画什么都没有。
我的HTML:
<div class="d-all t-all m-all group following_prompt">
<button type='button' id='hideshow' value='hide/show' class="close"><span class="icon-cross black right"></span></button>
<section class="center group">
<h1>You're not following anyone yet</h1>
<p>Get following to fill your feed with just the stuff you wanna see</p>
</section>
<article class="d1-d3 t1-t4 m-all user_following">
{{ member:profile uid="{author}" }}
<a href="/profile/{{ username }}" class="user_avatar d1 m1">{{ gravatamatic:quicky
email = "{email}"
size = "64"
}}</a>
<section class="d2-d3 m2-m4 author_bio">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>
<a class="global_btn_white" href="/">Follow {{ username }}</a>
</section>
{{ /member:profile }}
</article>
</div>
我的JS:
jQuery(document).ready(function(){
$('#hideshow').on('click', function(event) {
$('.following_prompt').toggle('show');
});
});
发布于 2015-08-25 21:14:51
简单的解决方法--谢谢萨蒂什
$('.following_prompt').hide()
发布于 2015-08-25 21:09:24
尝试使用hidden
类:
.hidden {display: none;}
并使用:
$('.following_prompt').toggleClass('hidden');
发布于 2015-08-25 21:16:06
试试这个。,
$('.following_prompt').hide()
$('#hideshow').on('click', function(event) {
$('.following_prompt').hide();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="d-all t-all m-all group following_prompt">
<button type='button' id='hideshow' value='hide/show' class="close"><span class="icon-cross black right">close</span></button>
<section class="center group">
<h1>You're not following anyone yet</h1>
<p>Get following to fill your feed with just the stuff you wanna see</p>
</section>
<article class="d1-d3 t1-t4 m-all user_following">
{{ member:profile uid="{author}" }}
<a href="/profile/{{ username }}" class="user_avatar d1 m1">{{ gravatamatic:quicky
email = "{email}"
size = "64"
}}</a>
<section class="d2-d3 m2-m4 author_bio">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>
<a class="global_btn_white" href="/">Follow {{ username }}</a>
</section>
{{ /member:profile }}
</article>
</div>
https://stackoverflow.com/questions/32204894
复制相似问题