[Wordpress] Cimy Header Image Rotator IE 7 flicker fix

Posted by Tony under Developers Corner

Okay so as promised here is the fix for the IE7 flicker fix for Cimy Header Image Rotator.   Find line #193 and replace that entire javascript section with this one:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
	<script type="text/javascript" language="javascript">
		var img = '$path';
 
		var swap_type = '$swap_type';
		var swap_rate = $swap_rate;
		var all_images = Array($js_array);
		var tot_images = $tot_images;
		var new_img;
 
		function cimy_change_image(old_img)
		{
			var d = new Date();
			var span_id = document.getElementById('$span_id');
			var tot_time;
 
			if (swap_type == "s")
				tot_time = d.getSeconds();
			else if (swap_type == "i")
				tot_time = d.getMinutes();
			else if (swap_type == "G")
				tot_time = d.getHours();
			else if (swap_type == "d")
				tot_time = d.getDay();
			else if (swap_type == "W")
				tot_time = d.getMonth();
			else
				tot_time = d.getYear();
 
			new_img = parseInt(tot_time / swap_rate) % tot_images;
 
			if (old_img != new_img) {
			  span_id.innerHTML = '<img src="'+img+'/'+all_images[new_img]+'" />';
			}
 
			t = setTimeout("cimy_change_image(new_img)", 1000);
		}
	</script>
Tags: ,

5 Responses to “[Wordpress] Cimy Header Image Rotator IE 7 flicker fix”

  1. 1 Claude | March 29th, 2009 @ 3:38 pm

    Just read your comment on Cimy and this post on your site.

    Wish your solution had appeared, sooner, for me.

    Might try Cimy on another site, soon.

    Thanks, for the input and solution to a problem.

    Claude.

  2. 2 Bob | April 1st, 2009 @ 11:56 am

    I agree that IE is crap, but is there a solution to stop the flicker in IE6? A lot of the families in our district still use IE6 and I don’t want to create ill will by putting something out there that causes complaints. Have implemented your solution, but the problem remains in IE6.

    Thanks.

  3. 3 Tony | April 2nd, 2009 @ 7:58 pm

    Unfortunately I don’t have IE 6. If I can find a computer with IE6 to test against then I’ll post an update with the IE6 fix.

  4. 4 Barb | April 24th, 2009 @ 3:33 pm

    Thank you, Thank you, Thank you!

  5. 5 Paul C | June 23rd, 2009 @ 12:51 am

    Tony,

    I sent the following to Marco but could the bug be in your patch? (Thanks for providing that, Marco is crazy to think the world will switch away from IE just because he says so)

    Marco,

    Found an interesting bug.
    Using;
    Wordpress 2.8
    Plugin version 1.0.0 plus Tony’s fix
    php 5.2.9
    MySQL 5.1.30

    I have set the swap rate to “seconds”. If I use 2 then all 26 header images rotate. If 5 secs, only the first 12. If 15 secs, only the first 4. If 25 secs, only the first 3. If 31 secs, only the first 2. See the pattern?

    After 60 seconds the script goes back and starts at header 1.

    All 26 headers use the same naming convention and are all exactly the same size.

    Your help would be appreciated, Thanks.

Join the conversation and voice your opinion