jQuery fadeOut:在一个页面上工作,但在另一个页面上不工作
所以这对于我正在开发的网站来说是非常具体的。
我为我正在开发的网站的展示/作品集部分创建了自己的、非常简单的 jQuery 旋转器。然而,在一个页面上,脚本可以工作,而在另一页上,甚至简单的 fadeOut() 似乎都不起作用。
这两个页面是:
1) http://dropyx.jonblower.co.uk
2) http://dropyx.jonblower.co.uk/the-work/
如果您单击关于<或>你会明白我的意思的。所有 javascript 都是内联的,如果您查看源代码就可以看到。
任何帮助将不胜感激。我整个下午都在为这个问题苦苦挣扎,这肯定是我一直忽略的简单事情。
编辑:有趣的是,尝试使用 fadeIn() 效果有效。我还可以在单击 2) 上的箭头时显示一个简单的“alert()”。
So this is pretty specific to a website I am working on.
I have created my own, very simple jQuery rotator for a showcase / portfolio part of a website I am working on. However on one page the script works and on another page not even a simple fadeOut() seems to work.
The two pages are:
1) http://dropyx.jonblower.co.uk
2) http://dropyx.jonblower.co.uk/the-work/
If you click on the < or > you will see what I mean. All the javascript is inline and can be seen if you view source.
Any help would be greatly appreciated. I've been struggling on this all afternoon, and it is bound to be something simple which I have been overlooking.
EDIT: Interestingly, trying to use fadeIn() effect works. I can also cause a simple "alert()" to display when the arrows are clicked on 2).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我忘记添加一个出现在我的首页而不是作品集页面上的类。这会添加 css 属性“overflow: auto;”这解决了问题。
知道这会很简单。
所以只是为了澄清。为了让 fadeOut 发挥作用,元素/容器必须正确包围其子元素。
I had forgotten to add a class which appears on my front-page but not the portfolio page. This adds the css property "overflow: auto;" which fixes the problem.
Knew it would be something simple.
So just to clarify. For fadeOut to work, element/container must enclose its children correctly.
看起来你的第二页在淡入之前就淡出了。在 firebug 控制台上运行淡入命令效果很好。
编辑:哎呀,你编辑的时候我正在编辑。 :)
It looks like your second page is just fading out before it ever fades in. Running the fade-in command on the firebug console works just fine.
EDIT: Oops I was editing while you edited. :)
该容器实际上并未正确包含元素。
在您的 CSS 添加中,
您还缺少 onclick 的 return false 。
The container isn't actually containing the elements properly.
In your CSS add
You're also missing the return false from the onclick.