当前位置: 代码迷 >> 跨浏览器开发 >> 鼠标经过图片放大的JS特效有关问题
  详细解决方案

鼠标经过图片放大的JS特效有关问题

热度:4300   发布时间:2013-02-26 00:00:00.0
鼠标经过图片放大的JS特效问题
我的JS代码如下所示:

$(function(){
//Larger thumbnail preview 
          $(".indexscell").hover(function() {
             $(this).css({'z-index' : '10000'});
             $(this).find('img').addClass("hover").stop().animate({
               marginTop: '0px', 
               marginLeft: '-30px', 
               top: '20%', 
               left: '20%', 
               width: '140px', 
               height: '140px',
               
             }, 200);
          } , function() {
             $(this).css({'z-index' : '0'});
             $(this).find('img').removeClass("hover").stop().animate({
               marginTop: '30px', 
               marginLeft: '0',
               top: '0', 
               left: '0', 
               width: '80px', 
               height: '80px', 
               
             }, 400);
          });
});


这个效果应该是鼠标经过图片,图片放大。
在chrome、360和IE8以上都没问题,但是在IE6下没效果为什么呢?
------最佳解决方案--------------------------------------------------------
$(function(){
//Larger thumbnail preview 
          $(".indexscell").hover(function() {
             $(this).css({'z-index' : '10000'});
             $(this).find('img').addClass("hover").stop().animate({
                   marginTop: '0px', 
                   marginLeft: '-30px', 
                   top: '20%', 
                   left: '20%', 
                   width: '140px', 
  相关解决方案