Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

How can I change header to random rotate


  #1  
Old Aug 7, 2009, 09:26 PM
fretbuzz
 
9 posts · Apr 2009
Here is the code:
Code:
<?php if (strpos($bfa_ata['configure_header'],'%image')!==FALSE AND 
$bfa_ata['header_image_javascript'] != "0" ) { ?>

var HeaderImages = new Array(<?php echo implode(",", bfa_rotating_header_images()); ?>);
var t; var j = 0
var p = HeaderImages.length
<?php if ($bfa_ata['header_image_javascript_preload'] == "Yes") { ?>
var PreLoadImages = new Array()
for (i = 0; i < p; i++){
	PreLoadImages[i] = new Image()
	PreLoadImages[i].src = HeaderImages[i]
}
<?php } ?>
function RotateHeaderImages(){
	if (document.body){
		HeaderImageContainer = document.getElementById('imagecontainer');
		HeaderImageContainer.style.background = 'url(' + HeaderImages[j] + ') <?php echo $bfa_ata['headerimage_alignment']; ?> no-repeat';
		j = j + 1
		if (j > (p-1)) j=0
		t = setTimeout('RotateHeaderImages()', <?php echo $bfa_ata['header_image_javascript']; ?>000)
	}
}
window.onload = RotateHeaderImages;

<?php } ?>
What do I change?

Thanks.
  #2  
Old Aug 8, 2009, 05:10 AM
juggledad's Avatar
juggledad
 
23,743 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
the loop is using 'j' as the id if the array image to display. eithor pick a randon number between 0 and 'i' for 'j' or resort the array some how each time thru the loop.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Tags
code, header, random, rotate

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to get a header image to rotate every 'N' seconds juggledad Header configuration & styling 49 May 22, 2011 04:01 PM
How to get the header images to rotate in a random fashion? ptuquoc Header configuration & styling 3 Jul 29, 2009 05:02 AM
Calling random images in the sidebar, similar to header cowgirlgeek Sidebars & Widgets 1 Jun 30, 2009 06:41 PM
Can Rotate Header and Resize Header work together? thetravelchronicle Forum How-To 10 Jun 24, 2009 07:24 PM
Header Images Fail to Rotate Yarrokon Header configuration & styling 10 Jun 8, 2009 10:17 AM


All times are GMT -6. The time now is 06:51 PM.


Powered by vBulletin® Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.