【问题标题】:Jquery sliding boxes not working in IE8Jquery滑动框在IE8中不起作用
【发布时间】:2012-06-26 03:46:26
【问题描述】:

在我的 html 标记上方添加 doctype 时,我的 Jquery 代码似乎无法在 IE8 中运行。

也许有一种方法可以重组这些代码以使其在 ie8 中运行。

$(document).ready(function(){
            //Caption Sliding (Partially Hidden to Visible)
            $('.boxgrid.caption').hover(function(){
                $(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
            }, function() {
                $(".cover", this).stop().animate({top:'161px'},{queue:false,duration:160});
            });
        });


The website can be seen here:

http://www.keencloudmedia.com/sample/test.html

提前致谢!

【问题讨论】:

  • “好像没用”?您能否说一下应该发生的事情和实际发生的事情? (您是否在控制台中遇到错误?什么都没有发生?是否发生了某些事情但这是错误的事情?)
  • 你能告诉我们html或/和错误吗?
  • P.S.这和your other question是同一个问题吗?
  • 同时发布相关的 CSS 和 HTML 代码。并告诉我们您遇到的确切错误[如果有的话]。
  • 感谢您的回复。这是链接:keencloudmedia.com/sample/test.html。单击“查看更多”按钮,您将看到我遇到 IE8 问题的滑动框。谢谢!

标签: javascript jquery html css jquery-animate


【解决方案1】:

试试这个

$(document).ready(function(){
        $('.boxgrid.caption').mouseenter(function(){
            $(".cover", this).stop().animate({'top':'0px'},160);
        });
        $('.boxgrid.caption').mouseleave(function() {
            $(".cover", this).stop().animate({'top':'161px'},160);
        });
    });

你可以使用这个元标记(与 jquery 一起使用非常好)

    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

【讨论】:

  • 嗨巴拉斯。感谢您的反馈意见。但是那个元标记已经在我的 html 文件中了。您可以在此链接中查看:keencloudmedia.com/sample/test.html。请单击“查看更多”按钮,这就是滑动框所在的位置。检查 Firefox 和 IE8 之间的区别。对我来说真的是地狱。大声笑
  • 嗨巴拉斯。您可以在此处找到该站点 :) keencloudmedia.com/sample/test.html。单击“查看更多”按钮,出现上面包含 jquery 代码的滑动框。我希望你能在 IE8 上测试它。 :) 谢谢!
  • 你需要更正你的 CSS 这是你的 CSS .caption .boxcaption { top: 161;左:0;您需要将 px 放在 161 的和处。像这样 => top:161px
  • 巴拉斯!有效!太感谢了! :) 我希望我能投票,但我需要 15 声望才能为你做到这一点。这里只是一个新手:) 再次感谢!
猜你喜欢
  • 2013-07-21
  • 1970-01-01
  • 1970-01-01
  • 2011-09-03
  • 2013-06-18
  • 2012-09-12
  • 2012-07-08
  • 1970-01-01
相关资源
最近更新 更多