2010-04-27, 03:40 PM
Hello,
Not intrinsically a problem for only MyBB but rather for all sites, random image rotation is needed to randomly change the images on the header, or background sections of my MyBB site and I'm in the search of an efficient way to do that
I've found a way at A list apart but this method has one drawback: It uses the method of giving <img> the "header.php" as the input and that causes reloading of images everytime a page reloads imposing unnecessary strain on both the server and the clients.
I'm using it in
<img id="background-img" class="bg" src="/images/header.php" alt="" /> at the "header" template of MyBB. You can test the script here and see the same background images reload when you refresh the page several times...
Is there a better way for random image rotation?
Thanks.
UPDATE: I have removed the img src="header.php" functionality and now am working on a more suitable way of randomly rotating images (image path output will come from the main application , not at the <img> layer)
Not intrinsically a problem for only MyBB but rather for all sites, random image rotation is needed to randomly change the images on the header, or background sections of my MyBB site and I'm in the search of an efficient way to do that
I've found a way at A list apart but this method has one drawback: It uses the method of giving <img> the "header.php" as the input and that causes reloading of images everytime a page reloads imposing unnecessary strain on both the server and the clients.
I'm using it in
<img id="background-img" class="bg" src="/images/header.php" alt="" /> at the "header" template of MyBB. You can test the script here and see the same background images reload when you refresh the page several times...
Is there a better way for random image rotation?
Thanks.
UPDATE: I have removed the img src="header.php" functionality and now am working on a more suitable way of randomly rotating images (image path output will come from the main application , not at the <img> layer)