2012-02-21 6 views
0

この投稿が怠け者だと思われますが、次のコードスニペットが私のサイトのJavascriptをどのように壊しているのかわかりません!このjavascript/jquery snippetによってInternet Explorerの互換性が壊れています

$(document).ready(function(){ 
$('a').click(function(){ 
    $(this).blur(); 
}); 
$('.opcion').hover(function() { 
    $(this).css('color','#FFF'); 
},function(){ 
    $(this).css('color','rgb(200,200,200)'); 
}); 
$('body ul li').each(function(){ 
    var tamcompleto = $(this).height() + 'px'; 
    $(this).hover(
     function(){ 
      $(this).stop().animate({height:tamcompleto},{queue:false, duration:600, easing: 'easeOutBounce'}); 
     }, 
     function(){ 
      $(this).stop().animate({height:'50px'},{queue:false, duration:600, easing: 'easeOutBounce'}); 
     } 
    ); 
    $(this).css('height','50px'); 
}); 
$('.comunicate').each(function(){ 
    $(this).click(function(){ 
     var center = 'height=436,width=465,top='+((screen.height - 436)/2)+',left='+((screen.width - 465)/2); 
     var address = 'comunicate.php?fid='+$(this).attr('id'); 
     window.open (address,'comunicate', center); 
    }); 
}); 
$('.objeto').each(function(){ 
    $(this).click(function() { 
     var center = 'height=380,width=900,top='+((screen.height - 380)/2)+',left='+((screen.width - 900)/2); 
     var address = $(this).attr('id'); 
     window.open (address,'Verarticulo', center); 
    }); 
    $(this).hover(function() { 
     $(this).css('backgroundColor','rgb(255,122,79)'); 
    },function() { 
     $(this).css('backgroundColor','rgb(200,200,200)'); 
    }); 
}); 
$('.elastica img').each(function(){ 
    $(this).css('width','100px'); 
    $(this).hover(function(){ 
     $(this).stop().animate({width: 200}, 150); 
    },function(){ 
     $(this).stop().animate({width: 100}, 150); 
    }); 
}); 
$('.elastica').click(function(){ 
    $('#imgampliada').attr('src', $(this).find('img').attr('src')); 
}); 
$('.icon').hover(function(){ 
    var newwidth = $(this).attr('data-width'); 
    $(this).find('img').mousemove(function(e){ 
     var newposition = e.pageX - newwidth/2; 
     $('#choice').html($(this).attr('id')); 
     $('#choice').stop(false, true).animate({width: newwidth, left: newposition}, 200); 
    }) 
}); 
$('#iconwrapper').mouseout(function(){ 
    $('#choice').html(''); 
    $('#choice').stop(false, true).animate({width: 0}, 100); 
}); 
}); 

function popup(mylink, windowname) 
{ 
if (! window.focus)return true; 
var href; 
if (typeof(mylink) == 'string') 
    href=mylink; 
else 
    href=mylink.href; 
window.open(href, windowname, 'width=400,height=200,scrollbars=yes'); 
return false; 
} 

javascriptのIE互換性についてもっと経験を積んだ人は、何が問題なのですか?このページはFFとChromeで完璧に動作します。 IEではjavascriptをロードしません。これは私を夢中にさせている!!

+1

_ "IEではJavaScriptをロードしていない" _ - 「ロードしていない」という意味ですか?走らない? IEのデバッグツールを何らかの理由で使用することができない場合は、一度に少し削除してコメントする古い忠実な方法に頼って問題を絞り込むことができます。 .each()を一度に実行してください)。 – nnnnnn

+0

エラーが生じますか?どのように動作しないかについての詳細は、コンソールに何らかのエラーがあります。 – Jon

+0

(IEでF12を試してみてください) –

答えて

0

popup()windowname)に渡す値にスペースがないことをもう一度確認してください。 window.open()がスペースを使用する場合、IEはそれを好きではありません。

関連する問題