PDA

View Full Version : ToolTip - Multiple Actions?



wildpeacockstudios
05-09-2008, 04:09 PM
1) Script Title: ToolTip - Multiple Action?

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip2.htm

3) Describe problem: I wanted to install 'Cool DHTML Tooltip II' on a 'Rollover Image'. Normally when the mouse is moved over a 'Rollover Image', the 'onMouseOver' action repaces the image with the 'Rollover OVER image'

Now after installing'Cool DHTML Tooltip II' script, when the mouse is moved over the 'Rollover Image', it displays the tooltip text but does not change the 'Rollover OVER image' image.

Is there any way to have two ACTIONS in 'onMouseOver', one to display the tooltip and another to change the UP image to the OVER image?

I am pretty green, so it will be nice if you can give an example code.:

TimFA
05-09-2008, 04:11 PM
Can you please post the code you are using?

jscheuer1
05-09-2008, 04:45 PM
<img src="some.gif" onmouseover="whatever();ddrivetip('Visit Yahoo.com');"
onmouseout="whatever();hideddrivetip();">

Just replace whatever() with your rollover code's functions exactly as they would have appeared if they were the only events.

wildpeacockstudios
05-09-2008, 08:43 PM
Thanks. It worked! Thanks.

wildpeacockstudios
05-09-2008, 09:13 PM
<img src="some.gif" onmouseover="whatever();ddrivetip('Visit Yahoo.com');"
onmouseout="whatever();hideddrivetip();">

Just replace whatever() with your rollover code's functions exactly as they would have appeared if they were the only events.
Every thing works except the tool tip does not show arrow. I have followed the instructions and copied the 'arrow2.gif' image in the site folder in the 'image' folder. Any suggestions?

jscheuer1
05-10-2008, 02:03 AM
I just guessing that you might need to (red):


<script type="text/javascript">

/***********************************************
* Cool DHTML tooltip script II- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="images/arrow2.gif">') //write out pointer image

var ie=do . . .

where images/ is the path to the arrow2.gif. If you need more help:

Please post a link to the page on your site that contains the problematic code so we can check it out.

wildpeacockstudios
05-12-2008, 03:29 PM
John:

It worked. For those reading this post, following is the information how it worked:

(1) I did a copy & past. The following line mad 'images' missing:

Copy & Paste:

document.write('<img id="dhtmlpointer" src="arrow2.gif">') //write out pointer image

John's suggestion:

document.write('<img id="dhtmlpointer" src="images[/COLOR]/arrow2.gif">') //write out pointer image

I believe, this may not be the proble. Next item may be the real problem.

(2) I had added this script into the a 'template' file. When I displayed the 'template' page, the 'arrow' in the tool tip did not display. But when I displayed a page (created from the 'template'), the tool tip displayed.

In any case it works & my mucho thanks to John.

Kirti

jscheuer1
05-12-2008, 03:48 PM
images/arrow2.gif

is a relative path, it must be valid relative to whatever page it appears on. It doesn't matter how it gets on that page (include, written by a script, both, or hard coded).

If the images folder is off of the root of the domain, it may be expressed as a network path:


/images/arrow2.gif

Then it will be valid anywhere on that domain.