| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Need help, Interesting Slide show !! | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() Hi all,
I am attempting to setup slide show with some preselected products. When tested it is running fine on my local host. When I am uploading it to X-cart in the home page (using e.g.: slide_show.tpl) a blank image box shows up where there is flickers but the actual images don't show up.... I have pasted the codes I tried below. Can someone suggest the error. It would be useful for lot many other users too. Thanks in advance... Codes: ------------------------------------------------- <html> <head> <script type="text/javascript"> <!-- var image1=new Image() image1. src="{$ImagesDir}/scroller images/offer-01.jpg" var image2=new Image() image2. src="{$ImagesDir}/scroller images/offer-02.jpg" var image3=new Image() image3. src="{$ImagesDir}/scroller images/offer-03.jpg" //--> </script> </head> <body> <img src="{$ImagesDir}/scroller images/100048.jpg" name="slide" border="0" width="115" height="56" /> <script> <!-- //variable that will increment through the images var step=1 function slideit(){ //if browser does not support the image object, exit. if (!document.images) return document.images.slide.src=eval("image"+step+".src" ) if (step<3) step++ else step=1 //call function "slideit()" every 2.5 seconds setTimeout("slideit()",2500) } slideit() //--> </script> </body> </html> --------------------------------------- Balinor, may I request you for help please...
__________________
X-Cart Pro 4.1.9 [Migrated from Gold 4.1.8 to Pro 4.1.9 - Feb 2008] Add Ons: X-FancyCategories, X-Magnifier, X-FeatureComparison, X-SpecialOffers |
|||||||||
#2
|
|||||||
|
|||||||
![]() You need to surround the javascript with {literal} tags:
{literal}Javascript here {/literal}
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||||
|
|||||||||
![]() Thanks Balinor for your prompt response as always...
Unfortunately the codes are still not working (reason of my delayed response). Was trying with some variations here & there... Is there any other error in the codes below which I might have overlooked? Your inputs would be of immense help. Thank you once again, Regards,
__________________
X-Cart Pro 4.1.9 [Migrated from Gold 4.1.8 to Pro 4.1.9 - Feb 2008] Add Ons: X-FancyCategories, X-Magnifier, X-FeatureComparison, X-SpecialOffers |
|||||||||
#4
|
|||||||
|
|||||||
![]() Well you can't use Smarty in there, so instead of {$ImagesDir} use skin1/images/
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#5
|
|||||||||
|
|||||||||
![]() Balinor thanks again !
Weird it still shows no result in home page (customer/home.tpl) where I called this file just below the help.tpl The file slide_show.tpl has these set of codes based on your inputs ------------- <html> <head> {literal} <script type="text/javascript"> <!-- var image1=new Image() image1. src="skin1/images/scroller images/offer-01.jpg" var image2=new Image() image2. src="skin1/images/scroller images/offer-02.jpg" var image3=new Image() image3. src="skin1/mages/scroller images/offer-03.jpg" //--> </script> {/literal} </head> <body> <img src="skin1/images/scroller images/100048.jpg" name="slide" border="0" width="115" height="56" /> {literal} <script> <!-- //variable that will increment through the images var step=1 function slideit(){ //if browser does not support the image object, exit. if (!document.images) return document.images.slide.src=eval("image"+step+".src" ) if (step<3) step++ else step=1 //call function "slideit()" every 2.5 seconds setTimeout("slideit()",2500) } slideit() //--> </script> {/literal} </body> </html> ------------- I am stuck there BOSS....
__________________
X-Cart Pro 4.1.9 [Migrated from Gold 4.1.8 to Pro 4.1.9 - Feb 2008] Add Ons: X-FancyCategories, X-Magnifier, X-FeatureComparison, X-SpecialOffers |
|||||||||
#6
|
|||||||
|
|||||||
![]() Are you trying to just put that code in? Because it doesn't work that way - you need to add the script in the head to the actual head of the site, which is in customer/home.tpl. Then you need to add the second part where you want it to show in the templates. Follow me? You don't add body, head, or html tags - those can only be in one place - customer/home.tpl
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#7
|
|||||||||
|
|||||||||
![]() Sorry Balinor if I sound dumb, though I understand what you mean but if I am not troubling you too much cud you let me know which part of the codes mentioned below I add in the home.tpl file & what of the balance codes I put in the said slide_show.tpl which has been called below help.tpl in the customer/home.tpl....
Please help me out of this silly thing....
__________________
X-Cart Pro 4.1.9 [Migrated from Gold 4.1.8 to Pro 4.1.9 - Feb 2008] Add Ons: X-FancyCategories, X-Magnifier, X-FeatureComparison, X-SpecialOffers |
|||||||||
#8
|
|||||||
|
|||||||
![]() Ok, open up customer/home.tpl and place this right before the </head> tag:
{literal} <script type="text/javascript"> <!-- var image1=new Image() image1. src="skin1/images/scroller images/offer-01.jpg" var image2=new Image() image2. src="skin1/images/scroller images/offer-02.jpg" var image3=new Image() image3. src="skin1/mages/scroller images/offer-03.jpg" //--> </script> {/literal} then put this part wherever you want the slideshow to appear: <img src="skin1/images/scroller images/100048.jpg" name="slide" border="0" width="115" height="56" /> {literal} <script> <!-- //variable that will increment through the images var step=1 function slideit(){ //if browser does not support the image object, exit. if (!document.images) return document.images.slide.src=eval("image"+step+".src" ) if (step<3) step++ else step=1 //call function "slideit()" every 2.5 seconds setTimeout("slideit()",2500) } slideit() //--> </script> {/literal} Usually that would go on customer/main/welcome.tpl if you wanted it to appear on the home page.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
|
#9
|
|||||||||
|
|||||||||
![]() Thanks Boss,
while I try the way suggested by you, let me specify what we are doing currently with welcome.tpl We are using the welcome.tpl for a Offer announcement with an 360 px by 145 px rectangle with 4 product images inside; each linking to an offer. We wanted to use the empty space below help.tpl (in our home page) to display additional offers in a flash like app. So what do I do .....
__________________
X-Cart Pro 4.1.9 [Migrated from Gold 4.1.8 to Pro 4.1.9 - Feb 2008] Add Ons: X-FancyCategories, X-Magnifier, X-FeatureComparison, X-SpecialOffers |
|||||||||
#10
|
|||||||
|
|||||||
![]() Then put the second bit of code wherever help.tpl is - probably customer/home.tpl
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
|
|||
X-Cart forums © 2001-2020
|