Reply
Variables called inside function not working ....
Old 10-17-2005, 05:58 AM Variables called inside function not working ....
Experienced Talker

Posts: 31
Hi,

I have created 'mouse hover image enlarge' function on my website, using some free script from www.javascript.com and a few mods to my CSS and HTML.

The key function in javascript is

HTML Code:
function showtrail(imagename,title,description,ratingaverage,ratingnumber,showthumb,height)
and my image HTML to kick this off is
HTML Code:
onmouseover="showtrail('../images/myimage.gif','Title','Description.','Other info.','Other Info.','1',203);"
onmouseout="hidetrail();"
The javascript works fine, but my problem is that my HTML is created using variables.

Images are called using NETQUOTEVAR:SECTIONIMAGE
Titles are called using NETQUOTEVAR:SECTIONTITLE
Descriptions are called using NETQUOTEVAR:SECTIONTEXT
Enlarged image is callled using CUSTOMVAR:HOVERIMAGE

so i modified my HTML to look like...

HTML Code:
onMouseOver="showtrail('CUSTOMVAR:HOVERIMAGE','NETQUOTEVAR:SECTIONNAME','NETQUOTEVAR:SECTIONTEXT','','','1',203;" onMouseOut="hidetrail();">
This should work as i use a program to flush through all of the variables and substitute them correctly, but for some reason it will not flush through the variables inside my function parenthesis.

Is there a reason for this ?????
Do I have to create a local set of variables to do local substitution?


Regards, Simon.

P.S. Here is an example of how my program flushes the variables.

If I create a template that looks like this:
HTML Code:
<!-- SectionNavImage_Hover HTML begin -->
<IMG SRC="NETQUOTEVAR:IMAGEFILE"
	  ALT="NETQUOTEVAR:ALTERNATETEXT"
	  BORDER=0
	  NETQUOTEVAR:IMAGEHEIGHT
	  NETQUOTEVAR:IMAGEWIDTH
	  NETQUOTEVAR:OTHERIMAGEMARKUP
	  ALIGN="ABSMIDDLE" title="" onMouseOver="showtrail('CUSTOMVAR:HOVERIMAGE','NETQUOTEVAR:SECTIONNAME','NETQUOTEVAR:SECTIONTEXT','','','1',203;" onMouseOut="hidetrail();">
<!-- SectionNavImage_Hover HTML end -->
My porgram will flush through the variables and deliver this :

HTML Code:
<!-- SectionNavImage_Hover HTML begin -->
<IMG SRC="../images/hazard/electrical/H010121.gif"
	  ALT="H010121"
	  BORDER=0
	  HEIGHT=111
	  WIDTH=80
	  
	  ALIGN="ABSMIDDLE" title="" onMouseOver="showtrail('','NETQUOTEVAR:SECTIONNAME','NETQUOTEVAR:SECTIONTEXT','','','1',203);" onMouseOut="hidetrail();">
<!-- SectionNavImage_Hover HTML end -->
Substituting the variables with the relevant file and image details. however it does not flush the ones called in the showtrail() funtion ??????
simonwar is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 10-17-2005, 10:12 AM
funkdaddu's Avatar
Web Design Snob

Posts: 636
What are NETQUOTEVAR: and CUSTOMVAR:? This isn't standard JS and if you're putting ":" into variable names it might screw things up. This looks like it's more than just HTML, is a server side language involved? I don't understand some of your code. Something like:
Code:
<IMG SRC="NETQUOTEVAR:IMAGEFILE">]
in straight HTML will produce nothing, am I missing something here?

EDIT: Wait is this an XHTML file when you say you're "HTML has variables in it"?

Last edited by funkdaddu : 10-17-2005 at 10:15 AM.
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 10-17-2005, 11:45 AM I am using "Actinic E-commerce" ...
Experienced Talker

Posts: 31
I am using Actinic E-Commerce, a program that effectively creates HTML pages by compilation of lots of templates, that I pick and chose options from.

I am not sure if this program uses XHTML or not ?

Once I have selected all my options, I create the Site from this progam by hitting "GENERATE SITE" and Actinic does the rest for me, creating every HTML page in my site.

NETQUOTEVAR: is a variable Actinic allocates, and
CUSTOMVAR: is a variable i set up to add some personalised items.

I appreciate if I should be talking to the Actinic support group on this topic but they have not been able to help so far, and wondered if the problem could be spotted through this forum.

If I have the following HTML in one of my Actinic templates:

HTML Code:
<IMG SRC="NETQUOTEVAR:IMAGEFILE">]
and click on GENERATE SITE, Actinic will automatically substitute the NETQUOTEVAR with a corresponding image file referenced through the Actinic software, e.g. ../MyImage.gif

HTML Code:
<IMG SRC="../MyImage.gif">]
Apologies if this is difficult to understand ?

Regards, Simon.
simonwar is offline
Reply With Quote
View Public Profile
 
Old 10-17-2005, 12:08 PM
funkdaddu's Avatar
Web Design Snob

Posts: 636
I understand now. Unfortunately, I think it's an error in how that system deals with the JavaScript code. You might have to work it out with them, sorry.
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Reply     « Reply to Variables called inside function not working ....
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13017 seconds with 12 queries