Results 1 to 9 of 9

Thread: Time Delay for Imagetooltip

  1. #1
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default Time Delay for Imagetooltip

    1) Script Title: Image w/ description tooltip

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...agetooltip.htm

    3) Describe problem: Does anyone know a good way to add a delay to the tool tip -- i.e as you rollover the link instead of opening instantly it takes..say 1 second. Thanks in advance,

    Mike

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Find this chunk of code inside the script. (function: doTooltip()).
    Code:
    function doTooltip(evt,num) {
    	if (!tooltip) return;
    	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
    	tipOn = true;
    	// set colors if included in messages array
    	if (messages[num][2])	var curBgColor = messages[num][2];
    	else curBgColor = tipBgColor;
    	if (messages[num][3])	var curFontColor = messages[num][3];
    	else curFontColor = tipFontColor;
    	if (ie4||ie5||ns5) {
    		var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
    		tipcss.backgroundColor = curBgColor;
    	 	tooltip.innerHTML = tip;
    	}
    	if (!tipFollowMouse) positionTip(evt);
    	else t1=setTimeout("tipcss.visibility='visible'",50);
    }
    Above I highlighted something(find it). In the highlighted, you will see the number 50. This is the number of milliseconds before it opens, change the 50 to 1000 for 1 second.
    Also, if you want to delay when it hides too.
    Find this part in the code:
    Code:
    function hideTip() {
    	if (!tooltip) return;
    	t2=setTimeout("tipcss.visibility='hidden'",100);
    	tipOn = false;
    }
    Change the highlighted to 1000 for 1 second.
    Jeremy | jfein.net

  3. #3
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    Works great. Also nice and easy. Can't thank you enough.

    Mike

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Anytime.
    Jeremy | jfein.net

  5. #5
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    Nile,
    After a bit of testing, I increased the delay on mouseover to '750' milliseconds, works most of the time as intended, However, there is an occasional error where the pop-up will not restore - i.e remains frozen on the screen even after the mouse leaves the link.. any thoughts?

    Mike

    In addition -- If you have multiple links with a pop-up, and jump from one to the next, the pop up appears instantly regardless of the number you enter. Thanks for any suggestions.

  6. #6
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Can you please show me the website/url that this script is located? That would help me.
    Jeremy | jfein.net

  7. #7
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    Gladly...
    http://www.stonehouseproductions.com/tv.html

    Much appreciated,

    Mike

  8. #8
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    It works fine for me... Hmm....
    Jeremy | jfein.net

  9. #9
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    Hey Nile,
    Thanks for looking into it for me. When you mouse over the first link it works perfectly... When you quickly jump to another thumbnail there is no longer a delay, but it switches instantly. Also occasionally when you mouse over a link and then use the scroll bar in the window the pop up will freeze in the middle of the screen. This only started happening when I increased the delay ?? Are you able to see it, or am I going crazy? Thanks a million,

    Mike

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •