I implemented and slightly mod开发者_如何学运维ified the easy slider jQuery plugin.
The problem is that sometimes the images dong get fully loaded.
Here is an image:
Here is how it should be:
It seems to be quite random, but whenever I do a hard refresh, (cmd+shift+r or ctrl+f5) it works everytime.
I´m not quite sure where the problem might be.
I give you a live example, hoping it helps, I would give you the code I used (but most you can see in the example) and I would know what to show you.
I hope I´m not being to vague, please ask if you need any clarification.
Thanks in advance!
Trufa
You want to use window.onload
instead of document.ready
here (the main difference being that images are loaded when onload
fires), like this:
$(window).load(function(){
$("#slider").easySlider({
auto: false,
continuous: true
});
});
When Easy slider is calculating heights and such, your images need to be loaded, running the plugin at the appropriate time should resolve that...since it won't run until they're loaded and have the right dimensions.
精彩评论