Javascript/Jquery幻灯片效果发生在错误的地方
Javascript/Jquery Slide effect happening in the wrong place
我的页面中有一个部分合并了Jquery滑动效果,但是应该滑动到原始位置的div
滑动得太低,然后刚好弹出到位。我不太确定它为什么会这样。我该怎么做才能使新的div
和原来的div
在同一平面上滑动?下面是我的JS以及一个小提琴的链接,这样你就可以明白我的意思了。谢谢!
$(document).ready(function() {
$("#content div").hide();
$("#tabs li:first").attr("id","current");
$("#content div:first").effect("slide", 800);
var animating = false;
$('#tabs a').click(function(e) {
e.preventDefault();
if ($(this).closest("li").attr("id") == "current"){
return;
}
else{
if(!animating)
$("#content div").hide("slide", {direction: "right"}, 800, function() { animating = true; });
$("#tabs li").attr("id","");
$(this).parent().attr("id","current");
$('#' + $(this).attr('name')).show("slide", {direction: "left"}, 800, function() { animating = false;});
}
});
});
我以前在使用jQuery的幻灯片效果时遇到过这个问题。尝试将position: absolute
添加到.con
类中。然后你要添加width: 100%
来填充父div。
相关文章:
- 意外的标识符错误jQuery
- 为什么'滚动到顶部'脚本导致类型错误?jQuery冲突
- "未定义不是函数“;错误jQuery,.replaces,scrollTop
- 错误Jquery.$.get()请求
- 非法调用错误 jquery
- 语法错误jquery句柄json
- '$未定义'错误jQuery
- 未捕获的语法错误:jQuery 字符串中意外的标记 ILLEGAL
- 错误:jQuery jquery.min.js?_=1420285687057:4 uncatch TypeError:
- 无论如何 - 未定义引用错误 $(jQuery UI)
- YUI 压缩器错误 - jQuery 自动键入
- 错误 JQuery 函数加载图像预览与 Safari 浏览器
- DIV 向下滚动到底部 脚本错误 JQUERY
- "未捕获引用错误:jquery未定义“-向下滚动菜单
- ajax成功操作后出现对象引用错误-jquery
- 错误--jQuery('span.timeago').timeago();不是函数
- 未知错误 - jQuery
- 未捕获的语法错误:jQuery中出现意外的标记ILLEGAL
- bgStretcher错误- jQuery冲突
- 访问名为“duration”的XML数据时的错误;Jquery