我使用jQuery和mouseenter/mouseleave创建了一个简单的动画.它在IE7,FF,Opera,Chrome和Safari中运行良好.
然而,IE7中出现了一些问题 - 根本没有任何反应 - 我甚至无法弹出警报框.
有人可以看一下我的代码,然后告诉我自己做错了什么才能把头发拉出来.
有问题的页面可以在www.ypfservice.net上查看 - 它是joomla安装的一部分,因此是膨胀的代码.
非常感谢
Ë
enter code here$('a.panelImage').parent().addClass('panel');
var numberLinks = $('a.panelImage').length;
for (var j=0; j<numberLinks; j++){
var currentLink = $('a.panelImage').eq(j);
$('<div class="fred"></div>').insertAfter(currentLink);
var gtr=(currentLink.position().left)+'px';
$(currentLink).next().css({ // ie div.fred
'position':'absolute',
'background-position':'0 0',
'top':'222px',
'left':gtr,
'display':'none',
'z-index':'1000',
'width':'5px',
'height':'5px',
'overflow':'hidden',
'backgroundImage':'url(http://www.ypfservice.net/templates/ypftemplate/images/foyerPreview.jpg)',
});
}
$('div.panel').mouseenter(function () {
$(this).find('div').animate({
height: '138px',
width: '184px'
}, 500)
})
.mouseleave(function () {
$(this).find('div').animate({
'width': '0px',
'height': '0px'
}, 500);
}); //end function
Run Code Online (Sandbox Code Playgroud)
邪恶的Microsoft 逗号得到了你!
'backgroundImage':'url(http://www.ypfservice.net/templates/ypftemplate/images/foyerPreview.jpg)',
Run Code Online (Sandbox Code Playgroud)
,,,,,,,他们来拥有我们!,,逗号无处不在,他们来这里是为了让程序员疯了!,,,
对象文字中的尾随逗号是一件坏事.. ,,,
| 归档时间: |
|
| 查看次数: |
97 次 |
| 最近记录: |