View Single Post
  #4  
Old 10-07-2003, 03:10 AM
 
CForrester CForrester is offline
 

Advanced Member
  
Join Date: Jul 2003
Posts: 46
 

Default 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
Reply With Quote