[jQuery] Re: ie6 and ie7 don't load image well when using Cycle plugin
Yes! jQuery support this aswell. It adds every onload/domready event in a queue. $(window).load(function(){ // do stuff onload }) $(window).load(function(){ // do other stuff onload }) But you should really look into some pattern instead. A relly simple and good pattern is the "Module Pattern" http://yuiblog.com/blog/2007/06/12/module-pattern/ You could then create you own namespaced object with init-methods and have options for when and where your methods should be executed Something like this var MyObject = function(){ return { init: function() { if ($('body').is('#home')) this.applySliderEvents() }, onloadInit: function(){ this.applySliderEvents() }, applySliderEvents: function(){ }, applyOtherStufEvents: function(){ } } }() $(document).ready(function(){ MyObject.init() }) $(window).load(function(){ MyObject.onloadInit() }) Just a relly basic example (and not the best optimized), but it might give you a better idea what can be done with simple init-methods and body-id's :)
[jQuery] Re: ie6 and ie7 don't load image well when using Cycle plugin
Hi Johan, Thanks a lot for your reply. It's true that i should move the code for cycle plugin to onload instead of Dom ready. I did test with window.onload = functionA; However the problem is the png transparency that use my other jquery script won't load if i use window.onload =functionA; Are there any other way to put the cycle function to onload but not using window.onload.? Thanks On Mar 30, 3:24 pm, johan.bores...@gmail.com wrote: > I can only guess that you've set the loop-delay too soon, and don't > control if the image have been loaded. That would explain why it looks > better the next time you arrive, since the image will be in the > browsercache. > > There's a couple of ways to go around this: > 1) Load the cycle plugin onload instead onDomReady > 2) Set a generic initial delay of the script (like 10 seconds) > 3) Check if the image have been downloaded before you initialize the > plugin > > On 30 Mar, 12:48, mangajin wrote: > > > I found that using cycle plugin byhttp://jquery.malsup.com/cycle/is > > very nice while seeing the page with FF and the rest. However, ie6 and > > ie7 sometime can't load the slide show well. To explain in details, > > ie6 and 7 at the firsttime loading page can't load the image for my > > website. However the second time i visit the same page with cycle > > pluging embedded, it would work fine. > > > I don't know if someone experience the same problem. I am not sure if > > it's about the size of image. Should i reduce it? or i should i move > > the javascript code from the header to the body? > > > Thanks
[jQuery] Re: ie6 and ie7 don't load image well when using Cycle plugin
I can only guess that you've set the loop-delay too soon, and don't control if the image have been loaded. That would explain why it looks better the next time you arrive, since the image will be in the browsercache. There's a couple of ways to go around this: 1) Load the cycle plugin onload instead onDomReady 2) Set a generic initial delay of the script (like 10 seconds) 3) Check if the image have been downloaded before you initialize the plugin On 30 Mar, 12:48, mangajin wrote: > I found that using cycle plugin byhttp://jquery.malsup.com/cycle/is > very nice while seeing the page with FF and the rest. However, ie6 and > ie7 sometime can't load the slide show well. To explain in details, > ie6 and 7 at the firsttime loading page can't load the image for my > website. However the second time i visit the same page with cycle > pluging embedded, it would work fine. > > I don't know if someone experience the same problem. I am not sure if > it's about the size of image. Should i reduce it? or i should i move > the javascript code from the header to the body? > > Thanks
[jQuery] Re: ie6 and ie7 don't load image well when using Cycle plugin
> I found that using cycle plugin byhttp://jquery.malsup.com/cycle/is > very nice while seeing the page with FF and the rest. However, ie6 and > ie7 sometime can't load the slide show well. To explain in details, > ie6 and 7 at the firsttime loading page can't load the image for my > website. However the second time i visit the same page with cycle > pluging embedded, it would work fine. > > I don't know if someone experience the same problem. I am not sure if > it's about the size of image. Should i reduce it? or i should i move > the javascript code from the header to the body? > > Thanks That's not much info to go on. What version of Cycle are you using? Have you tried the latest? Can you post a link to your page?