| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Random Top Logo Banner | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Hi All,
This is my current X-Cart http://216.204.82.125/nutriteam/xcart/customer/home.php I would like to make the top banner Image rotate on refresh or when you goto a different category. I found some javascript online, but I am not sure how to implement it into head.tpl. Any help woudl be greatly appreciated. Thanks!! Here is the random image script i found: This is supposed to be put in the <head> of a normal html file: <script> // Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/ function create() { this.width = '' this.height = '' this.src = '' this.border = '' } ads = new Array() for(var i=1; i<=5; i++) { ads[i] = new create() } ads[1].width = "281" ads[1].height = "59" ads[1].src = "images/quote001.gif" ads[1].border = "0" ads[1].mouseover = "Click to Refresh" ads[2].width = "257" ads[2].height = "52" ads[2].src = "images/quote002.gif" ads[2].border = "0" ads[3].width = "257" ads[3].height = "52" ads[3].src = "images/quote003.gif" ads[3].border = "0" ads[4].width = "257" ads[4].height = "52" ads[4].src = "images/quote004.gif" ads[4].border = "0" ads[5].width = "257" ads[5].height = "52" ads[5].src = "images/quote002.gif" ads[5].border = "0" var n = Math.random() + '' n = parseInt(n.charAt(5)) if(n >5) { n = n - 5 } else if(n==0) { n = n + 5 } n += "" var image = ads[n] var ad = "" ad += '[img]' + image.src + '[/img] And then this is supposed to be put in the body: script language="JavaScript"> <!-- hiding this script document.write(ad) // --> </script> |
|||||||
#2
|
|||||||
|
|||||||
![]() Hello mlannen,
You need to put your java script under {literal} tag. For example {literal}<script> your script code here</script>{/literal} I hope this help. regards, Anand
__________________
X-Cart: 4.7.7 LIVE Skin:Ultra by xcartmods.co.uk X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9) --------------- Server: Linux php: 5.3 mysql: 5.0.89 ---------------- |
|||||||
#3
|
|||||||||
|
|||||||||
![]() youll find a few random image scripts in the custom mods forum
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. ![]() ![]() |
|||||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|