It’s going to be hard to explain because it is really weird. But I’ll do my best.
I have a scrollbar that needs to appear when the content overflow the wrapper. Simple.
But a script or a part of my html is not loading on the first time that the user visits the page. When he visits the page a second time, it works.
To see it, click on “portfolio”:
http://chuckbox.net/chromatemp/
-> The first time, you’ll not see the scrollbar
-> Click again, and you’ll see it now (and you’ll see it all the time from now)
I have this problem only with google chrome.
FYI, I use jscrollpane for the scrollbar, but I don’t think the problem is there.
Visiting the page shows the following:
The images don’t have their
heightattribute set, and the browser has to wait either for your external CSS or for the image itself before it knows the image size.You have the following snippet:
It calls the
jScrollPaneplugin when the DOM is loaded, but this may occur before the external CSS is loaded. This means that the plugin, when it is called, doesn’t have access to its correct length unless the CSS (or all images) is already in the browser cache (and does not read it later, apparently).To fix this, either
include the
heightattribute with the images:<img src=... height=240>, orwait for the external CSS to load:
Alternatively, you might initialise the plugin on
readythen repeat onload(if the plugin allows that).