我这里有一些代码可以在 Firefox 中完美运行,但不能在 chrome 或 IE 中运行,
我的javascript是这样的
` $(document).ready(function() { $("#clientLoginPop").show(); $("#clientLoginPop").animate({"left": "-=400px"}, "fast"); }); $("#clientLoginCloseLink").click(function () { $("#clientLoginPop").animate({"left": "+=400px"}, "fast"); }); $("#contactUsPopLink").click(function () { $("#contactUsPop").show(); $("#contactUsPop").animate({"left": "-=437px"}, "fast"); }); $("#contactUsClose").click(function () { $("#contactUsPop").animate({"left": "+=474px"}, "fast"); }); }); `
最后 div 的 css 看起来像这样,我认为相当重要的是它与浏览器的右侧对齐:(客户端登录 div 看起来相似,只是高度不同)
` #contactUsPop { width:437px; right:-437px; margin-top:220px; position:fixed; height:217px; background-color:white; z-index:2; } `
所以在 Firefox 中发生的情况是 div 向左移动,然后当它关闭时又移回到右侧。在 Chrome 中时,div 似乎根本不弹出?
该网站的 URL 是这样的:
http://clearcreativegroup.com/devcorner/clear3/
选项卡位于浏览器的右侧,任何建议都会有帮助,谢谢!
最佳答案
$("#clientLoginPop").animate({"right": "+=400px"}, "fast");
关于javascript - JQuery 无法在 Chrome 中运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2570141/