admin管理员组文章数量:1279118
I have this code that works great in all browsers but not IE6, and I have no idea why, can anyone shed any light on this?
$("#handle").toggle(
function () {
$('#login').animate({
marginTop: '0',
}, 1000);
$("#handle").addClass('opened');
return false;
},
function () {
$('#login').animate({
marginTop: '-280',
}, 1000);
$("#handle").removeClass('opened');
return false;
}
);
I have this code that works great in all browsers but not IE6, and I have no idea why, can anyone shed any light on this?
$("#handle").toggle(
function () {
$('#login').animate({
marginTop: '0',
}, 1000);
$("#handle").addClass('opened');
return false;
},
function () {
$('#login').animate({
marginTop: '-280',
}, 1000);
$("#handle").removeClass('opened');
return false;
}
);
Share
Improve this question
edited Aug 5, 2010 at 16:33
Ken Redler
23.9k8 gold badges59 silver badges69 bronze badges
asked Aug 5, 2010 at 16:25
sea_1987sea_1987
2,95412 gold badges46 silver badges69 bronze badges
1
- IE6 just loads with errors on page – sea_1987 Commented Aug 5, 2010 at 16:27
3 Answers
Reset to default 11You have trailing mas in the object literals passed to animate()
. IE does not support this. This should work:
$('#login').animate({
marginTop: '0' //No ma, can you see it?
}, 1000);
Yes, I guess I can.
The EVIL COMMA has GOT you !!
marginTop: '0', // remove ma
and
marginTop: '-280', // remove ma
Trailing mas are a big NoNo in IE's.
Also shouldn't it be
"-280px" // added "px"
本文标签: javascriptjQuery crossbrowser issueStack Overflow
版权声明:本文标题:javascript - jQuery cross-browser issue - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741264639a2368227.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论