此javascript/jquery片段破坏了Internet Explorer兼容性
Internet Explorer compatibility broken by this javascript/jquery snippet
如果这篇文章看起来很懒,我很抱歉,但我真的不知道下面的代码片段是如何破坏我的网站中的Javascript的!
$(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。这让我疯了!!
只需仔细检查您为windowname
传递给popup()
的值中是否没有空格。IE不喜欢window.open()
使用空格。
相关文章:
- "工具提示"jQuery插件坏了
- 我的按钮坏了
- 节点JS:时间机器坏了——timekeeper.travel不做时间旅行
- HTML/JavaScript:为什么不'我的纽扣坏了
- 我的素数函数坏了,但我没有;我不知道为什么
- Uglifier是不是弄坏了我的睡衣
- 我升级了Knockout.js,现在我的模板坏了
- 为什么范围$手表坏了
- 所有的javascript都 ajax.aspnetcdn.com/ajax/ 坏了?打破所有外部引用?自周五以来
- 角度控制器功能坏了
- 谷歌可视化图表API示例坏了,如何修复它们
- 将Facebook应用程序移动到新服务器,现在它坏了
- 为什么我的代码坏了
- 野生动物园浏览器中的后退按钮坏了
- 砌体坏了(可能是经典)
- 旋转相机后,Three.js的skybox似乎坏了
- 验证不是't工作,现在我的网站也坏了
- 什么'It’我的石头剪刀坏了
- 此javascript/jquery片段破坏了Internet Explorer兼容性
- 如何检测是否已经使用JavaScript安装了Internet Explorer插件