首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > 跨浏览器开发 >

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

2012-12-17 
大侠进!鼠标经过图片放大的JS特效问题$(function(){//Larger thumbnail preview$(.indexscell).hover(fu

大侠进!鼠标经过图片放大的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', 
                   height: '140px'//,/////多了一个逗号,IE8-不识别这种json数据报错了
                     
             }, 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'//,/////多了一个逗号,IE8-不识别这种json数据报错了
                     
             }, 400);
          });
});


[其他解释]
引用:
JavaScript code?1234567891011121314151617181920212223242526$(function(){//Larger thumbnail preview           $(".indexscell").hover(function() {             $(this).css({'z-index' : '1000……


还是老大厉害呀!!

热点排行