| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
javascript in templates | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
javascript in templates
I actually have 2 questions. First is it possible to implement javascript in the teplates, I plugged a script in and the entire page went blank. I cut it from a static page so I know that it works.
Second, where are the head tags located for the store?
__________________
.::Mike |
|||||||
#2
|
|||||||
|
|||||||
found the head tags
I found the head tags inside of home.tpl for each area...
__________________
.::Mike |
|||||||
#3
|
|||||||||
|
|||||||||
Yup, just make sure you wrap the javascript in
{literal} javascript {/literal} tags so smarty doesn't break it.
__________________
Groovico Used by X-carters the world over: Marketing Manager Pro Bundle For X-cart Featured Product Manager for X-cart Feed manager pro for X-cart http://www.firetanksoftware.com Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X |
|||||||||
#4
|
|||||||
|
|||||||
re: mouseover javascript in head.tpl.."literal" us
Hi , I'm trying to get a mouseover menu for an adult lingerie +toys site and after careful editing of the menu.js i thought it might work......but theres no mouseover.
Any ideas were I'm going wrong. menu.js contents :- var imagePairs = new Array(); var imagePairCount = 0; var imageDir = "/images/"; function loadImagePair() { // expects four arguments: name, targetname, and on and off image file path/names. imagePairs[imagePairCount] = new Object(); imagePairs[imagePairCount].name = loadImagePair.arguments[0]; imagePairs[imagePairCount].targetname = loadImagePair.arguments[1]; imagePairs[imagePairCount].imageOn = new Image(); imagePairs[imagePairCount].imageOn.src = imageDir + loadImagePair.arguments[2]; imagePairs[imagePairCount].imageOff = new Image(); imagePairs[imagePairCount].imageOff.src = imageDir + loadImagePair.arguments[3]; imagePairCount++; } function loadImages() { // four arguments: name, targetname, and on and off image file path/names. loadImagePair('Anal_Ecstasy', 'Anal_Ecstasy', 'analecstasy-button_on.jpg', 'analecstasy-button_off.jpg'); loadImagePair('Erotic_oils', 'Erotic_oils', 'eroticoils-button_on.jpg', 'eroticoils-button_off.jpg'); loadImagePair('Forhim', 'Forhim', 'forhim-button_on.jpg', 'forhim-button_off.jpg'); loadImagePair('Funandgames', 'Funandgames', 'funandgames-button_on.jpg', 'funandgames-button_off.jpg'); loadImagePair('Gayzone', 'Gayzone', 'gayzone-button_on.jpg', 'gayzone-button_off.jpg'); loadImagePair('LadiesPleasureZone', 'LadiesPleasureZone', 'lpz-button_on.jpg', 'lpz-button_off.jpg'); loadImagePair('Lingerie', 'Lingerie', 'lingerie-button_on.jpg', 'lingerie-button_off.jpg'); loadImagePair('LustforLatexandLeather', 'LustforLatexandLeather', 'lll-button_on.jpg', 'lll-button_off.jpg'); loadImagePair('Playmates', 'Playmates', 'playmates-button_on.jpg', 'playmates-button_off.jpg'); loadImagePair('RealFeelStrap-ons', 'RealFeelStrap-ons', 'realfeel-button_on.jpg', 'realfeel-button_off.jpg'); loadImagePair('StockingsandPanties', 'StockingsandPanties', 'stockings-button_on.jpg', 'stockings-button_off.jpg'); loadImagePair('Vibrators', 'Vibrators', 'vibrators-button_on.jpg', 'Vibrators-button_off.jpg'); loadImagePair('SpecialOffers', 'SpecialOffers', 'specialoffers-button_on.jpg', 'specialoffers-button_off.jpg'); } function imgOn(imageName) { var i; window.status = imageName; for (i=0; i<imagePairCount; i++) { if (imagePairs[i].name == imageName) { var cmdstr = "document." + imagePairs[i].targetname + ".src = imagePairs[i].imageOn.src"; eval(cmdstr); } } } function imgOff(imageName) { var i; window.status = imageName; for (i=0; i<imagePairCount; i++) { if (imagePairs[i].name == imageName) { var cmdstr = "document." + imagePairs[i].targetname + ".src = imagePairs[i].imageOff.src"; eval(cmdstr); } } } the head.tpl has the menu.js attached to it in the same dir and the button images are in a "images" subdir within that dir. Should it be a full path to it e.g. htt://www....../xcart/skin1/images/ etc Not too sure if i understand about this "literal" in the .js Any help appreciated. thanks |
|||||||
#5
|
|||||||
|
|||||||
This is from the Smarty site:
Quote:
It's just so the script doesn't get touched until the user's browser gets to it. |
|||||||
|
|||
X-Cart forums © 2001-2020
|