开发者

jQuery - Easy slider plugin images "truncated"

开发者 https://www.devze.com 2023-01-24 12:55 出处:网络
I implemented and slightly mod开发者_如何学运维ified the easy slider jQuery plugin. The problem is that sometimes the images dong get fully loaded.

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:

jQuery - Easy slider plugin images "truncated"

Here is how it should be:

jQuery - Easy slider plugin images "truncated"

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消