Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Javascript Tooltip Problem

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-02-2009, 08:52 AM
  SamsonWebDesign's Avatar 
SamsonWebDesign SamsonWebDesign is offline
 

Senior Member
  
Join Date: Oct 2008
Location: East Sussex, UK
Posts: 101
 

Default Javascript Tooltip Problem

I want a tooltip for my site but have a real problem getting the javascript to work.

I've followed the instructions to the letter and nothing seems to get this script working.
Here is the tooltip script I'm looking to use.
http://www.walterzorn.com/tooltip/tooltip_e.htm

Here are the instructions for implementing the script which are pretty easy!
1. Link wz_tooltip.js into the html file
Copy the following line to inside the BODY section, preferably immediately after the opening <body> tag:
<script type="text/javascript" src="wz_tooltip.js"></script> If necessary, adapt the path 'src="wz_tooltip.js"' to the JavaScript file. Note: Use the downloaded file only, do not hardlink wz_tooltip.js from my site.

2. Specify tooltip text inside onmouseover eventhandlers

Each of the html tags to display a tooltip requires an onmouseover and an onmouseout attribute like so:
Including the script at the beginning of the body section ensures that the tooltips are almost immediately functional, before loading the page has been finished. <a href="index.htm" onmouseover="Tip('Some text')" onmouseout="UnTip()">Homepage</a> That's all. No title attributes, no container DIV. As you can see, the text to be displayed must be enclosed with single quotes, and be passed to a function Tip().

I've uploaded the javascript files and am calling them from the /customer/home.tpl as follows:
PHP Code:
{literal}<script type="text/javascript" src="{$SkinDir}/modules/wz_tooltip/wz_tooltip.js"></script>{/literal

Then implemented the call to mouseover for the tooltip on the link as follows:
PHP Code:
<a href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&featured{/if}" onmouseover="Tip('Some text')" onmouseout="UnTip()"><font class="ProductTitle">{$products[product].product}</font></a

I've tried the javascript before the </head> tag and after the <body> tag and nothing seems to make this work.

Anyone got any ideas!!!!!
__________________
Versions 4.1.11 to 4.6.4 ... when will the new versions end!

Custom X-Cart driven e-commerce sites, skins and installations at www.samsonwebdesign.co.uk
Reply With Quote
  #2  
Old 04-03-2009, 12:30 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Javascript Tooltip Problem

As you wrap code with {literal} {$SkinDir} variable won't be replaced with its content.
So remove literal - it is not required in your case.
External js file linked with script tag is not parsed by Smarty.
I believe that you placed this script in skin1/modules/wz_tooltip/
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #3  
Old 04-03-2009, 04:29 AM
  SamsonWebDesign's Avatar 
SamsonWebDesign SamsonWebDesign is offline
 

Senior Member
  
Join Date: Oct 2008
Location: East Sussex, UK
Posts: 101
 

Wink Re: Javascript Tooltip Problem

Quote:
Originally Posted by Victor D
As you wrap code with {literal} {$SkinDir} variable won't be replaced with its content.
So remove literal - it is not required in your case.
External js file linked with script tag is not parsed by Smarty.
I believe that you placed this script in skin1/modules/wz_tooltip/

Awesone. That works fine now. I knew it would be something simple but couldn't see the wood for the trees!

Thanks.
__________________
Versions 4.1.11 to 4.6.4 ... when will the new versions end!

Custom X-Cart driven e-commerce sites, skins and installations at www.samsonwebdesign.co.uk
Reply With Quote
  #4  
Old 10-07-2009, 10:07 AM
 
rct rct is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 89
 

Default Re: Javascript Tooltip Problem

I am using the same script, however I am putting it in the embedded static page. It is not working if I put the script in skin1/modules/Tooltips/wz_tooltip (see the code below) , but it will work fine if I have all the codes in the page content ... meaning - a big long inefficient way of coding.

Any advice? Thanks

************************************************** *******
code:

<body>{literal}

<script type="text/javascript" src="http://www.reallycooltees.com/public_html/modules/Tooltips/wz_tooltip.js" >
</script>
{/literal}

<a href=" " onmouseout="UnTip()" onmouseover="Tip('Why do we charge your art fees?')" >$30.0/hour</a>
</body>
__________________
JOHN - v.5.3.X biz, X-payment 3.X
Reply With Quote
  #5  
Old 10-08-2009, 02:46 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Javascript Tooltip Problem


Should be something like this
Code:
/skin1/modules/Tooltips/wz_tooltip.js
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #6  
Old 10-08-2009, 06:20 AM
 
rct rct is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 89
 

Default Re: Javascript Tooltip Problem

thanks Vic, for the advice, tried, still not working, however found a similar, but not as fancy.
__________________
JOHN - v.5.3.X biz, X-payment 3.X
Reply With Quote
  #7  
Old 10-08-2009, 06:31 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Javascript Tooltip Problem

Is this file located in the directory public_html/skin1/modules/Tooltips/ on your server currently?

not in public_html/modules/Tooltips/ - this directory is not accesible from the web.
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #8  
Old 10-08-2009, 05:46 PM
 
rct rct is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 89
 

Default Re: Javascript Tooltip Problem

You are correct, that's the problem , I put it in the inaccessible directory! Thanks so much for helping!
__________________
JOHN - v.5.3.X biz, X-payment 3.X
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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
Forum Jump


All times are GMT -8. The time now is 10:22 AM.

   

 
X-Cart forums © 2001-2020