[jQuery] Changing images doesn´t work on IE6
Hi all. I wrote about this in a previous post, but now I find out new things trying to find a solution. To summarize: I dessign an image gallery, and when I click on one thumbnail I want to get the bigger version, changing the src attribute of an image located inside a div. The first time I load the default image when the page is loadinf, there is no problem, but when I click in a different thumbnail, in IE6 the image cannot load the file, but it does in FF and IE7. You have an example in: http://www.icorpal.com/index.php?seccion=promocionescodigo=8 The code to achieve this is: 1. To load the default image: $(#vista_promocion).load_image(http://www.icorpal.com/helpers/ image_cropped.php? width=300height=200position=centerquality=75codigo=617); 2. To change that image, when the user clicks on the thumbnail: $(a.preview_promocion).each(function(){$(this).bind (click,function(){$(#vista_promocion img).attr(src, http:// www.icorpal.com/helpers/image_cropped.php?width=300height=200position=centerquality=75codigo=+$(this).attr(id)); });}); Today I discovered two things that make it work: 1. If the image is in the cache it works. 2. If after $(#vista_promocion img).attr(src,... I write an alert function, it works also. I tried to set a delay function here to check if that can help, but it doesn´t help. Well, can anybody help? Thanks in advanced.
[jQuery] Re: Please help! Why is this not working on IE6?
I´m still trying to fix this. Something new I discovered: If I load the image directly in the browser, writing the URL in the address bar and after this, I reload the problem page and click on the thumbnail of the image I loaded, it works. It seems that when the image is in the cache, there is no problem, but IE6 doesn´t wait to finish downloading the image when it is not in the cache. So the thing is that when I set the attribute src of the image after the page is loaded, in IE6 doesn´t work if the image is not in the cache. Please help!! I don´t know how to explain this to my client.
[jQuery] Please help! Why is this not working on IE6?
Hi: There is a gallery with several thumbnails, and when I click on one of them I can get a bigger version on a div, when I click on that bigger version I get a thickbox version of the picture. You can see an example in the URL: http://www.icorpal.com/index.php?seccion=promociones http://www.icorpal.com/index.php?seccion=promocionescodigo=8 codigo=8 This works on Firefox and IE7, but the substitution of the bigger version and the thickbox is not working on IE6. The code to achieve this is: To change the href of the thickbox and to change the bigger image: $(a.preview_promocion).each(function(){this.onclick = (function(){$(a#thickbox_loader).attr(href,images/inmuebles/+this.id+ .jpg); $(#vista_promocion img).attr(src, http://www.icorpal.com/helpers/image_cropped.php?width=300height=200posit ion=centerquality=75codigo=+this.id); })}); To get the default bigger image when the page loads (this works on IE6): $(#vista_promocion).load_image(http://www.icorpal.com/helpers/image_cropp ed.php?width=300height=200position=centerquality=75codigo=617); That script refers to the next HTML code: div id='images_promocion_container' a id=thickbox_loader href=images/inmuebles/617.jpg class=thickboxdiv id='vista_promocion'/div/a div id=mycarousel ul id=images_promocion lia href=javascript:void(0) class=preview_promocion id=617 title= alt=img src=images/inmuebles/tb_617.jpg alt= width=96//a/li lia href=javascript:void(0) class=preview_promocion id=621 title= alt=img src=images/inmuebles/tb_621.jpg alt= width=96//a/li lia href=javascript:void(0) class=preview_promocion id=636 title= alt=img src=images/inmuebles/tb_636.jpg alt= width=96//a/li /ul /div /div It is like the each(function() and this.id is not working on IE6. Thank you in advanced. I revised the code but now I´m lost.
[jQuery] Re: Please help! Why is this not working on IE6?
I´ve changed it, but it´s still not working :'( You can check the modified version in http://www.icorpal.com/index.php?seccion=promocionescodigo=8 I hate IE so much!!! Thank you. Any ideas? Alexandre Plennevaux wrote: try this: $(a.preview_promocion).bind(click,function(){ $this= $(this); $(a#thickbox_loader).attr(href,images/inmuebles/+$this.attr('id')+.jp g); $(#vista_promocion img).attr(src, http://www.icorpal.com/helpers/image_cropped.php?width=300height=200posit ion=centerquality=75codigo=+$this.attr('id')); })});