为什么要滑动切换跳跃?以及如何让它仅适用于点击的文章?
好吧,这是我的 jsfiddle - http://jsfiddle.net/8947F/
基本上,slideToggle 似乎添加了然后去掉底部的一些高度,这样它看起来就像跳跃一样...
而且点击会影响所有隐藏的 div,我如何让它只适用于特别
是这里是我的 jquery
$(function() {
$('article .folder-hover').hide();
$('article').hover(function(){
$(this).children('.folder-hover').show();
},
function(){
$(this).children('.folder-hover').hide();
});
});
$(function() {
$('article .folder-items').hide();
$("article").click(function () {
$(".folder-items").slideToggle("slow");
});
});
任何获取它的方法仅当开始单击其父级时才影响子级 div? 那“跳跃”是怎么回事???
提前致谢
Ok so here is my jsfiddle - http://jsfiddle.net/8947F/
basically the slideToggle seems to add then take away some height at the bottom so that it looks like it jumps...
Also the clicking affects all of the hidden divs, how do I get it to only apply to the one in particular
here's my jquery
$(function() {
$('article .folder-hover').hide();
$('article').hover(function(){
$(this).children('.folder-hover').show();
},
function(){
$(this).children('.folder-hover').hide();
});
});
$(function() {
$('article .folder-items').hide();
$("article").click(function () {
$(".folder-items").slideToggle("slow");
});
});
any way to get it so it only affects the child div when it's parent is begin clicked?
and what is up with that 'jump'???
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看看这个 jsfiddle
http://jsfiddle.net/8947F/14/
工作顺利!
check out this jsfiddle
http://jsfiddle.net/8947F/14/
works nice n smooth!
因为它正在选择所有
文件夹项目
。您应该通过传递上下文(在您的情况下为this
)将其限制为在当前文章中查找。试试这个。从folder-items css类中删除高度100%,这将解决跳跃问题
演示
Because it is selecting all the
folder-items
. You should restrict it to find with in the current article being clicked by passing a context(this
in your case). Try this.Remove height 100% from folder-items css class this will fix the jumping issue
Demo
尝试更改
http://jsfiddle.net/8947F/4/
Try changing
http://jsfiddle.net/8947F/4/