0

所以一切加载在 chrome 和 firefox 中启动良好,但在 IE 中它在启动时不起作用,我必须单击一个链接转到另一个页面,然后返回以便脚本开始工作。

jQuery:

$(document).ready(function(){
   $('.bigimage').mouseover(function(){
      $(this).stop().animate({
         "width": "110%",
         "left": "0px",
         "top": "0px"
      }, 200,'swing');
   }).mouseout(function(){ 
      $(this).stop().animate({
         "width": "100%",
         "left":"15px",
         "top":"15px"
      }, 200,'swing');
   });
});

html

<ul class="getbig"> 
   <li>
      <a href="*"><img class="bigimage" src="pic.png" title="mytitle"></a>
   </li>
   <li>
      <a href="*"> <img class="bigimage" src="pic2.png" title="mytitle2"></a>
   </li>
</ul>

CSS:

.getbig{ position:relative; left: 50px; top: 0px; width:200px; height:78px;  }

.bigimage{ position:relative; width:100%; left:15px; top:15px}

所以我想知道它是否与 IE 中的文档类型有关。

4

1 回答 1

0

Would this have anything to do with IE nagging about not letting scripts run unless you press the accept button?

Yes - does it work if you 'allow blocked content'?

If so, there are two solutions:

  • load your page through a web server instead of as a local file (IE restricts the page from running scripts only for local files)

  • use Mark of the Web (MOTW). But this is a non-standard workaround, and introduces other issues (IE will then disable any links to other file types)

于 2012-10-18T08:21:55.963 回答