Jquery width() function on chrome gives me different values on loading and reload(F5)

冷暖自知 提交于 2019-12-05 20:15:47

Try to set the height and width after everything is loaded, i.e, use $(window).load(function() {//set height and width here});.

I believe it appears to work fine in firefox because of caching. Maybe I'm wrong, just set-up jsFiddle. It'll be lot easier to pin-point the issue.

Juan Diego

Here is the solution,

jQuery behaving strange after page refresh (F5) in Chrome

Use this

$(window).load(function() {});

Out instead of:

$(document).ready(function() {});

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!