jQuery fadeOut:在一个页面上工作,但在另一个页面上不工作

发布于 2024-08-09 09:48:24 字数 598 浏览 4 评论 0原文

所以这对于我正在开发的网站来说是非常具体的。

我为我正在开发的网站的展示/作品集部分创建了自己的、非常简单的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

表情可笑 2024-08-16 09:48:24

我忘记添加一个出现在我的首页而不是作品集页面上的类。这会添加 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.

错々过的事 2024-08-16 09:48:24

看起来你的第二页在淡入之前就淡出了。在 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. :)

深府石板幽径 2024-08-16 09:48:24

该容器实际上并未正确包含元素。

在您的 CSS 添加中,

#showcase-page-0 { float: left; }

您还缺少 onclick 的 return false 。

The container isn't actually containing the elements properly.

In your CSS add

#showcase-page-0 { float: left; }

You're also missing the return false from the onclick.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文