jQuery 褪色不透明度问题

发布于 2024-08-02 04:03:49 字数 374 浏览 2 评论 0原文

对于客户,我试图让该网站在 IE 和其他网络浏览器中运行(目前仅在 Mac 版 Safari 和 Firefox 中运行):http://www.randomscripts.net/think_company_world/main.php 我在图片上使用 JQuery 的 fadeIn 和 fadeOut 函数在后台循环播放它们。 对于上面列出的浏览器之外的所有其他浏览器,它只是在内容上显示一个黑框。 我认为这可能与 opacity: CSS 属性有关,但我不太确定。

如果有人可以看一下,我将非常感激。

For a client, I am attempting to get this site to work in IE and other web browsers (currently only works in Safari and Firefox for Mac): http://www.randomscripts.net/think_company_world/main.php I am using JQuery's fadeIn and fadeOut functions on the pictures to cycle them through in the background. For every other browser beside those listed above, it simply displays a black box over the content. I am thinking that it may have to do with the opacity: CSS property but am not quite sure.

If anyone could take a look, I would really appreciate it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

简单爱 2024-08-09 04:03:49

它似乎对我来说工作得很好(Vista 下的 Chrome、IE8 和 Firefox 3)。

您确定图像有时间加载吗? 如果将图像大小调整为 100x100 并重新运行脚本,是否会遇到同样的问题?

其他想法

我在第 320 行(nav 6 的子选项)上收到错误,因为页面上没有任何 id 为 nav6_sub 的项目,因此这可能会给您带来问题。

您在该页面上复制了大量代码(您是复制并粘贴还是在循环内创建它?),您可能应该考虑创建一个 jQuery 插件或其他东西。 我一直发现这个页面很有用(当然还有 jQuery 文档): http://www.learningjquery.com/2007/10/a-plugin-development-pattern

另外,它可能不相关,但子导航周围的 HTML 可能需要一些清理。 而不是

<ul>
    <li><a href="#" id="nav5" onmouseover="dropDown('nav5_sub')"></a></li>
        <div class="sub" id="nav5_sub">
            <li>Private Client Log In</li>
            <li>Student Log In</li>
        </div>
    </li>
</ul>

You 应该有类似的东西:

<ul>
    <li>
        <a href="#" id="nav5" onmouseover="dropDown('nav5_sub')"></a>
        <ul class="sub" id="nav5_sub">
            <li>Private Client Log In</li>
            <li>Student Log In</li>
        </ul>
    </li>
</ul>

It seems to be working fine for me (Chrome, IE8 and Firefox 3. under Vista).

Are you sure the images are having time to load? Do you get the same problem if you resize the images to 100x100 and re-run the script?

Other thoughts

I'm getting an error on line 320 (sub options for nav 6) because you don't have any item on the page with an id of nav6_sub so that may be causing problems for you.

You're duplicating a lot of code on that page (are you copying and pasting or having it created inside a loop?), you should probably look at creating a jQuery plugin or something. I've always found this page to be useful (as well as the jQuery docs of course): http://www.learningjquery.com/2007/10/a-plugin-development-pattern

Also, it's probably not related, but your HTML around the sub navigation could use some cleaning up. Instead of

<ul>
    <li><a href="#" id="nav5" onmouseover="dropDown('nav5_sub')"></a></li>
        <div class="sub" id="nav5_sub">
            <li>Private Client Log In</li>
            <li>Student Log In</li>
        </div>
    </li>
</ul>

You should have something like have:

<ul>
    <li>
        <a href="#" id="nav5" onmouseover="dropDown('nav5_sub')"></a>
        <ul class="sub" id="nav5_sub">
            <li>Private Client Log In</li>
            <li>Student Log In</li>
        </ul>
    </li>
</ul>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文