Rotating Banners refreshes without you having to refresh a page. You can see it here.
http://www.rebelrosenetworks.com/forum/index.php
<center>
<ilayer id="l1">
<layer id="l2">
<div id="l1">
<div id="l3" style="position:relative">
</div>
</div>
</layer>
</ilayer>
<script language="JavaScript">
<!--
var bannerArray = new Array();
var myCount=0;
// Banner Code Assignment
bannerArray[0] = "<A HREF=\"http://www.yourdomain.com\"><IMG SRC=\"http://www.yourdomain.com/banner.jpg\" border=\"0\" width=\"470\" height=\"60\"></A>";
bannerArray[1] = "<A HREF=\"http://www.yourdomain.net\"><IMG SRC=\"http://www.yourdomain.com/banner.jpg\" border=\"0\" width=\"470\" height=\"60\"></A>";
bannerArray[2] = "<A HREF=\"http://www.yourdomain.net\"><IMG SRC=\"http://www.yourdomain.com/banner.jpg\" border=\"0\" width=\"470\" height=\"60\"></A>";
bannerArray[3] = "<A HREF=\"http://www.yourdomain.net\"><IMG SRC=\"http://www.yourdomain.com/banner.jpg\" border=\"0\" width=\"470\" height=\"60\"></A>";
bannerArray[4] = "<A HREF=\"http://www.yourdomain.net\"><IMG SRC=\"http://www.yourdomain.com/banner.jpg\" border=\"0\" width=\"470\" height=\"60\"></A>";
bannerRotate();
function bannerRotate() {
if(myCount > bannerArray.length-1){myCount=0;}
// Write out rotation
if (document.all){ // it is IE
document.all.l3.innerHTML=bannerArray[myCount];
}
else if (document.layers){ // it is NN
document.layers.l1.document.layers.l2.document.open();
document.layers.l1.document.layers.l2.document.write(bannerArray[myCount]);
document.layers.l1.document.layers.l2.document.close();
}
setTimeout("bannerRotate()", 3000);
myCount++;
}
// -->
</script>
</center>
--edit by IchBin
Updated code for it to work in other browsers.
http://www.tinyportal.net/index.php/topic,7747.msg209101.html#msg209101
finally got it working right.
Parse error: syntax error, unexpected '<' in /home/username/public_html/Sources/Load.php(1708) : eval()'d code(35) : eval()'d code on line 1
Put it in a scriptbox, not a phpbox.
Doesn't display the image. Shows up on the source code as this:
Quote<script language="JavaScript">
<!--
var bannerArray = new Array();
var myCount=0;
// Banner Code Assignment
bannerArray[0] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd3a.jpg\" border=\"0\" width=\"133\" height=\"200\"></A>";
bannerArray[1] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd5a.jpg\" border=\"0\" width=\"133\" height=\"200\"></A>";
bannerArray[2] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd6a.jpg\" border=\"0\" width=\"133\" height=\"200\"></A>";
bannerArray[3] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd7a.jpg\" border=\"0\" width=\"133\" height=\"200\"></A>";
bannerArray[4] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd3a.jpg\" border=\"0\" width=\"133\" height=\"200\"></A>";
bannerRotate();
function bannerRotate() {
if(myCount > bannerArray.length-1){myCount=0;}
// Write out rotation
if (document.all){ // it is IE
document.all.l3.innerHTML=bannerArray[myCount];
}
else if (document.layers){ // it is NN
document.layers.l1.document.layers.l2.document.open();
document.layers.l1.document.layers.l2.document.write(bannerArray[myCount]);
document.layers.l1.document.layers.l2.document.close();
}
setTimeout("bannerRotate()", 3000);
myCount++;
}
// -->
</script>
But no execution.
Eliana I use the code Rose shows and it works fine I just removed the size restraints and put it in a table - make sure you put it in a script box -
<center>
<table width="470" height="85" border="0" align="center" cellpadding="2" cellspacing="0">
Ã, <tr>
Ã, Ã, <td height="100" align="center" valign="middle"><center>
Ã, Ã, Ã, Ã, <ilayer id="l1">
Ã, Ã, Ã, Ã, <layer id="l2">
Ã, Ã, Ã, Ã, <div id="l1">
Ã, Ã, Ã, Ã, Ã, <div id="l3" style="position:relative"> </div>
Ã, Ã, Ã, Ã, </div>
Ã, Ã, Ã, Ã, </layer>
Ã, Ã, Ã, Ã, </ilayer>
Ã, Ã, Ã, Ã, <script language="JavaScript">
<!--
var bannerArray = new Array();
var myCount=0;
// Banner Code Assignment
bannerArray[0] = "<A HREF=\"http://LINKED WEBSITE URL HERE\" target=\"_blank\"><IMG SRC=\"IMAGE SOURCE HERE\" border=\"0\"></A>";
bannerArray[1] = "<A HREF=\"http://LINKED WEBSITE URL HERE\" target=\"_blank\"><IMG SRC=\"IMAGE SOURCE HERE\" border=\"0\"></A>";
bannerArray[2] = "<A HREF=\"http://LINKED WEBSITE URL HERE\" target=\"_blank\"><IMG SRC=\"IMAGE SOURCE HERE\" border=\"0\"></A>";
bannerArray[3] = "<A HREF=\"http://LINKED WEBSITE URL HERE\" target=\"_blank\"><IMG SRC=\"IMAGE SOURCE HERE\" border=\"0\"></A>";
bannerArray[4] = "<A HREF=\"http://LINKED WEBSITE URL HERE\" target=\"_blank\"><IMG SRC=\"IMAGE SOURCE HERE\" border=\"0\"></A>";
bannerArray[5] = "<A HREF=\"http://LINKED WEBSITE URL HERE\" target=\"_blank\"><IMG SRC=\"IMAGE SOURCE HERE\" border=\"0\"></A>";
bannerArray[6] = "<A HREF=\"http://LINKED WEBSITE URL HERE\" target=\"_blank\"><IMG SRC=\"IMAGE SOURCE HERE\" border=\"0\"></A>";
bannerArray[7] = "<A HREF=\"http://LINKED WEBSITE URL HERE\" target=\"_blank\"><IMG SRC=\"IMAGE SOURCE HERE\" border=\"0\"></A>";
bannerRotate();
function bannerRotate() {
if(myCount > bannerArray.length-1){myCount=0;}
// Write out rotation
if (document.all){ // it is IE
document.all.l3.innerHTML=bannerArray[myCount];
}
else if (document.layers){ // it is NN
document.layers.l1.document.layers.l2.document.open();
document.layers.l1.document.layers.l2.document.write(bannerArray[myCount]);
document.layers.l1.document.layers.l2.document.close();
}
setTimeout("bannerRotate()", 3000);
myCount++;
}
// -->
</script>
Ã, Ã, Ã, </center></td>
Ã, </tr>
</table>
</center>
Eliana Tamerin turn the EDITOR off from your settngs area and it wont do that :up:
It still does not work, even if I turn off the editor. I added a new block without the editor and that doesn't work. The images show up fine when you go to the URL separately. It is in a script box, no editor, with the URLs working. What is the problem, then? The code? What TP version is this made for?
It is a script for no special version of TP, can you post the code as you are using so we can take a look at it and maybe a link to your site?
ok, first problem is you changed the script and added bbc code, you have [/url] at the end of each one.
I have it up on my test site with your code and it is working great:
http://rebelrose.com/newtheme/smf/index.php
Try this:
<center>
<table width="470" height="85" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td height="100" align="center" valign="middle"><center>
<ilayer id="l1">
<layer id="l2">
<div id="l1">
<div id="l3" style="position:relative"> </div>
</div>
</layer>
</ilayer>
<script language="JavaScript">
<!--
var bannerArray = new Array();
var myCount=0;
// Banner Code Assignment
bannerArray[0] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd3a.jpg\" border=\"0\" width=\"133\" height=\"200\"></a>";
bannerArray[1] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd5a.jpg\" border=\"0\" width=\"133\" height=\"200\"></a>";
bannerArray[2] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd6a.jpg\" border=\"0\" width=\"133\" height=\"200\"></a>";
bannerArray[3] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd7a.jpg\" border=\"0\" width=\"133\" height=\"200\"></a>";
bannerArray[4] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd3a.jpg\" border=\"0\" width=\"133\" height=\"200\"></a>";
bannerRotate();
function bannerRotate() {
if(myCount > bannerArray.length-1){myCount=0;}
// Write out rotation
if (document.all){ // it is IE
document.all.l3.innerHTML=bannerArray[myCount];
}
else if (document.layers){ // it is NN
document.layers.l1.document.layers.l2.document.open();
document.layers.l1.document.layers.l2.document.write(bannerArray[myCount]);
document.layers.l1.document.layers.l2.document.close();
}
setTimeout("bannerRotate()", 3000);
myCount++;
}
// -->
</script>
</center></td>
</tr>
</table>
</center>
Quote<center>
<ilayer id="l1">
<layer id="l2">
<div id="l1">
<div id="l3" style="position:relative">
</div>
</div>
</layer>
</ilayer>
<script language="JavaScript">
<!--
var bannerArray = new Array();
var myCount=0;
// Banner Code Assignment
bannerArray[0] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd3a.jpg\" border=\"0\" width=\"133\" height=\"200\"></A>";
bannerArray[1] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd5a.jpg\" border=\"0\" width=\"133\" height=\"200\"></A>";
bannerArray[2] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd6a.jpg\" border=\"0\" width=\"133\" height=\"200\"></A>";
bannerArray[3] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd7a.jpg\" border=\"0\" width=\"133\" height=\"200\"></A>";
bannerArray[4] = "<A HREF=\"http://www.devira.info\"><IMG SRC=\"http://www.devira.info/images/brooke/jennaboyd3a.jpg\" border=\"0\" width=\"133\" height=\"200\"></A>";
bannerRotate();
function bannerRotate() {
if(myCount > bannerArray.length-1){myCount=0;}
// Write out rotation
if (document.all){ // it is IE
document.all.l3.innerHTML=bannerArray[myCount];
}
else if (document.layers){ // it is NN
document.layers.l1.document.layers.l2.document.open();
document.layers.l1.document.layers.l2.document.write(bannerArray[myCount]);
document.layers.l1.document.layers.l2.document.close();
}
setTimeout("bannerRotate()", 3000);
myCount++;
}
// -->
</script>
</center>
That's exactly what I put in the scriptbox with no editor.
http://www.kalinini.devira.info is the site. Log in with the username "test" (without the quotes) and the password "test" (without the quotes) to see the block. This is for viewing purposes only, please.
EDIT: FYI, the SMF board changes the entered </a> to [/url]. That's why it shows up as such on the last code I posted, and why it showed up on this one until I put the nobbc tags in.
I see it rotating pictures however I made a mistake in the code, look at the very first image, I forgot to change the [/url]
It never changed the script on any of the ones I used.
Well, it's up with your code, and it still doesn't show. Doesn't work on any skin (thought that might be a source of the problem).
And it changes the script when you post it in SMF. Or at least it did when I posted it. I don't know why. Maybe it's my user settings. Anyways, the point is, I used the exact same code you have, and it doesn't work. I'm about to just give up on it here, because it's getting to be not worth my time. None of the code works, none of the settings work, etc.
I saw it on your site when I logged in the rotating images of a little girl, I don't understand what you are saying it wrong it is even working on my test site. I entered that exact code in a scriptbox.
Well, it doesn't want to work on my browser then. Doesn't make any sense to me, though. Did you make it Firefox 2 unfriendly?
Tested it on Flock (firefox based) as well, doesn't work there. Works on Opera. I can assume it works on IE then. Didn't you make the code compatible with Firefox?
It is just a script code I have had for a while I did not write it. I use IE and yes well it works on that. Did you see it on my test site using your firefox? No one has ever said it didn't work on FF before so I am not sure what to tell you there.
Download Firefox and check it out.
I did just that and I see it does not show in FireFox, I am not sure how to fix that problem, sorry.
Firefox is crap Eliana (jmho) use a real browser - there are so many thing Firefox wont do, see, or recognize it is worthless. The code is a universal code written by a javascript person on a javascript webdev site, attacking Rose for a code isnt right!!!
I did not see anywhere that she had just found the code and tweaked it. I assumed, thus, that she had written it. Don't go flaming me for not knowing that she didn't write it. My apologies to her if I offended her, it was unintentional.
dont feel bad guys it happens to the best of us :up:
so lets all chill out and have some fun :D
If it can help:
Using Firefox 2 with Windows 2000 professional ===> does not display any rotating banners.
marzi
You have to have javascript enabled in your browser, it works just fine for me
I tried with FF2 (tried to enable everything I could) and it didnt work. I do agree though - FF is an inferior browser. Just because it is trendy atm...
And no, I am not an IE man (I use linux)
I was just wondering how to slow down the rotation a little.
Quote from: Ghostwriter on February 26, 2007, 06:12:46 PM
I was just wondering how to slow down the rotation a little.
Locate this:
setTimeout("bannerRotate()", 3000);Change the 3000. A higher number to slow the rotation, lower number will speed up the rotation
This is working in a test block just fine for me in IE. I added the target=\"_blank\" to this and would like to make one other change. Perhaps someone here would know how to do this. I would like to be able to use banners of differing dimensions in the rotation. I can change the display size for the individual banners settings so they display accuratly but this results in the overall size of the display box jumping up and down in size. Is there a way to make the box stay one size, that is large enough to accommodate my largest banner? Then, have the smaller sizes display centered within this space?
anyone know the fix for the firefox issue? i to got it to work great (thanks rose!)... only when i render with IE though.... i would like to use this myself, so i am actively searching...
Hi Guys,
Does anyone have a fix for this to work on FF?
Cheers :)
I don't know javascript very well, but try replacing this function:
function bannerRotate() {
if(myCount > bannerArray.length-1){myCount=0;}
// Write out rotation
if (document.all){ // it is IE
document.all.l3.innerHTML=bannerArray[myCount];
}
else if (document.layers){ // it is NN
document.layers.l1.document.layers.l2.document.open();
document.layers.l1.document.layers.l2.document.write(bannerArray[myCount]);
document.layers.l1.document.layers.l2.document.close();
}
setTimeout("bannerRotate()", 3000);
myCount++;
}
If that doesn't work, I don't know what to tell you.
with this code;
function bannerRotate() {
if(myCount > bannerArray.length-1){myCount=0;}
document.getElementById("l3").innerHTML=bannerArray[myCount];
setTimeout("bannerRotate()", 3000);
myCount++;
}
Hi IchBin,
Doesnt work in either IE or FF. Thanks for trying, appreciate it :)
Since I don't have the images nor the setup to trouble shoot this, if you'd like some help I'll need to look at it on your site. PM me a temp admin account if you'd like some help.
IchBin,
Just pm'd you. Thank you :)
Ok, that should be fixed. It appears they were using an "L" in the "l3" id. I was using a "1". :) The code above should work for everyone else as well.
IchBin,
Awesome they look great! Thank you so very much for your help. I really appreciate it! Thank you!!
Nice. Got it working good. Is it possible to also have it start random as well with the rotation. vs just going in order everytime?
That would be a completely different script. This is just a rotation banner, not a random banner. If you'd like that, I'm sure you could find something with a google search. Bring the script here, and we can help possibly.
This doesent work for me if i want that to add in a block and take html javascript whit new install of TP 1.075 the script doesent work at any java code i use in there