top



HI
how are u??

i have this code for make 3 banners one of them appear each time i refresh the page .. but i have problem where putting the links
can i have help to understand it better?? thanx

Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
txt="نص الوصلة";
url="[url=http://رابط]http://رابط[/url] الموقع/";
alt="التعريف النصي";
banner="[url=http://رابط]http://رابط[/url] الصورة";
width="468";
height="60";
}
if (ad==2) {
txt="نص الوصلة";
url="[url=http://رابط]http://رابط[/url] الموقع/";
alt="التعريف النصي";
banner="[url=http://رابط]http://رابط[/url] الصورة";
width="468";
height="60";
}
if (ad==3) {
txt="نص الوصلة";
url="[url=http://رابط]http://رابط[/url] الموقع/";
alt="التعريف النصي";
banner="[url=http://رابط]http://رابط[/url] الصورة";
width="468";
height="60";
}
document.write('<center>');
document.write('<a href="' + url + '" target="_top">');
document.write('<img src="' + banner + '" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt="' + alt + '" border=0><br>');
document.write('<small>' + txt + '</small></a>');
document.write('</center>');
// End -->
</SCRIPT>

So you want a bannerrotator? Smile

Code:
banner=['banner1.png','banner2.png','banner3.png'];
number=Math.floor(Math.random()*banner.length);

function rotation() {
document.write("<style> selector { background-image : url('" + banner[number] + "'); } <\/style>");
}

rotation();
This script will randomly show a background on the image, which selector is written in the script. Remember to change banner1.png, ban.. etc.
If its your top banner, you want to add the effect to, then chose a transparent image as its src, so youll could see the random show image.

*its hard to explain when im on my phone, but can try take a deeper look at your problem tomorrow, if theres any problem. Smile

not working Impatient .. did i missed something??

Code:
<SCRIPT LANGUAGE="JavaScript">
banner=['http://i46.servimg.com/u/f46/12/36/04/46/aocee_10.png','http://i46.servimg.com/u/f46/12/36/04/46/yoeccc10.png','http://i46.servimg.com/u/f46/12/36/04/46/ou10.png'];
number=Math.floor(Math.random()*banner.length);

function rotation() {
document.write("<style> selector { background-image : url('" + banner[number] + "'); } <\/style>");
}

rotation();
</SCRIPT>

You haven't changed the selector, in the document.write phrase. Smile

If you fx use PunBB, can you use this selector "#pun-logo img".
But then remember to go to your admin panel, display, pics management, and change the banner img to a transperent one, with same size as the image from the rotation.

i'm phpBB2 Impatient ... what should i change?? please??