...

View Full Version : Tooltip Speed



phantom007
07-15-2009, 06:43 PM
Hi

Please consider the attached zip file.

Its a fully functional javascript tooltip script.

When you run the index.html file in the zip achieve, and you hover on the text, it ill display a baloon tooltip.

Is there anyway I can make that tooltip delay in showing?

I mean it should be like that when I mouseover the text, aftr 2 seconds the popup should appear.


Please tell me which line should I modify to make this happen?


Many thanks

fside
07-16-2009, 07:06 AM
I'm sure it's a pointlessly idle question. But I'm curious. What's all this:

Focusinterview.com - PHP Interview Questions & Answers

openDesk - Support Ticket System

phantom007
07-16-2009, 07:10 AM
Its not pointless. I need it to implement it on my site. Why on earth do you think its pointless?

fside
07-16-2009, 08:06 AM
Why on earth do you think its pointless?

Are you saying one or more of these sites is experiencing the problem? I didn't know that these bore some connection to your problem, so I thought it a very idle sort of question on my part. But I was curious.

That's all I meant by it.

phantom007
07-16-2009, 08:08 AM
Ok, i m facing the issue on a newly site that I am making, hence need the help.


Thanks

fside
07-16-2009, 08:58 AM
That's a jQuery question, specifically about the Beauty Tips plugin for message popups. And there's a Javascript Framework forum here, whether or not one agrees that jQuery is a framework rather than a library. So jQuery questions go there.

As for bt, they say you need the hoverintent plugin (http://cherne.net/brian/resources/jquery.hoverIntent.html). That allows for programmed delays before painting the help bubble. Maybe they've included it in the bt demo, because the delay is also demonstrated there.

phantom007
07-17-2009, 08:08 AM
But there must be something in the bt code itself that is controlling the speed? or can control the speed?

I dont wanna go for the hoverintent plugin as it has limited features, like, i cannot show an HTML table in the bubble if I use hoverintent because it only allows you to have the text in the TITLE tag if DIV.


Pls help

fside
07-17-2009, 06:16 PM
You'd have to look at the documentation for bt. But I thought they said they needed the additional script to run a delay.

Comes down to it, I guess you could use a setTimeout() to call the popup function. Then you control the delay.

phantom007
07-17-2009, 06:31 PM
can u pls implement it in my script for me? I am new to JS.


Many thanks

fside
07-18-2009, 11:35 AM
I'm new to such plugins, myself. It looks like hoverIntent requires the popup text to be in the title attribute. That's going to limit you. You'll get the delay in and out, but . . . I wonder if just contacting the guy who wrote Beauty Tips at his site wouldn't be best? and even to ask if he could include timed delays, fades, etc?

I suppose if it were me, I might be tempted to write something like this myself. In fact, I have something very similar. But I think the best, here, might just be to contact the programmer directly.

scrappy
07-18-2009, 06:06 PM
It seems overly complicated for what it is; I'd be tempted to write my own instead, at least I'd know exactly how it all worked then and could implement new features much more easily (I have exactly zero knowledge of jQuery). I don't know about you.

If you want to use the script and not HI, best thing to do is probably contact the author, as already suggested.

barkermn01
07-18-2009, 06:45 PM
erm


var delay = 1250; // set your time delay
var funct = "alert('hello')"; // set your function to call
eval("setTimeout('"+funct+"',"+delay+")");


That will do it for you

Philip M
07-18-2009, 06:59 PM
erm


var delay = 1250; // set your time delay
var funct = "alert('hello')"; // set your function to call
eval("setTimeout('"+funct+"',"+delay+")");


That will do it for you

That does not work! Why post untested code?


var delay = 3000; // set your time delay
var funct = "alert('Hello!')"; // set your function to call
var tim = setTimeout(funct,delay);

fside
07-19-2009, 08:48 AM
That will do it for you

Even if you had it right, the problem is not knowing the name of the event handler in the first place. The HI does work, but seems to work only on the "title" attribute. And he wants full innerHTML. Plus he didn't want to use - HI.

As far as the title attribute - maybe I'm missing something with that. Can you include an image tag with url in a title attribute that HI are BT will convert into the proper url in the bubble?

phantom007
07-21-2009, 05:45 AM
That does not work! Why post untested code?


var delay = 3000; // set your time delay
var funct = "alert('Hello!')"; // set your function to call
var tim = setTimeout(funct,delay);



Where do I paste this code?


Also, can we have a close button on the balloon, clicking on which would close the tooltip balloon?



EDIT: I appreciate your help but this is not solving my purpose. The popup does appear after a little delay but I wanted somethng else.

I wanted the popup to appear after 2 secs only if I am hovering the mouse on the object for 2 seconds. If I mouseover the object for less then 2 seconds it should not appear.


Can this be done?



Many thanks

fside
07-21-2009, 12:05 PM
Also, can we have a close button on the balloon, clicking on which would close the tooltip balloon?


Again, this DOES work - but if you use hoverIntent. That's what the BT guy particularly wrote for, and he makes various provisions in BT specifically for HI. (I mentioned some title attr restriction, prev, forget that - I didn't understand)

Just try it. Load in HI. Load BT, jQuery. But also load HI. And then put this in a similar place in your script to what you already have - it'll delay before opening, and there's a little close box:



hello='<br>my fav video';

$().ready(function(){

$('#1').bt("<input type=\"button\" onclick=\"this.parentNode.parentNode.style.display='none';\"><img src=\"lullabot.png\" width=\"200\" height=\"197\"> what a lovely day" +hello, {
width: 200,
fill: 'yellow',
cornerRadius: 10,
padding: 20,
strokeWidth: 1,
trigger: ['mouseover', 'click'],
hoverIntentOpts: {
interval: 1000,
timeout: 5000
}
});

});

phantom007
07-21-2009, 12:14 PM
Again, this DOES work - but if you use hoverIntent. That's what the BT guy particularly wrote for, and he makes various provisions in BT specifically for HI. (I mentioned some title attr restriction, prev, forget that - I didn't understand)

Just try it. Load in HI. Load BT, jQuery. But also load HI. And then put this in a similar place in your script to what you already have - it'll delay before opening, and there's a little close box:



hello='<br>my fav video';

$().ready(function(){

$('#1').bt("<input type=\"button\" onclick=\"this.parentNode.parentNode.style.display='none';\"><img src=\"lullabot.png\" width=\"200\" height=\"197\"> what a lovely day" +hello, {
width: 200,
fill: 'yellow',
cornerRadius: 10,
padding: 20,
strokeWidth: 1,
trigger: ['mouseover', 'click'],
hoverIntentOpts: {
interval: 1000,
timeout: 5000
}
});

});




Hi


The close button does work but the delay does not :(

fside
07-21-2009, 12:33 PM
The close button does work but the delay does not :(

The "interval" is only set to 1 second. The exit delay is 5 seconds. You should see that it takes 5 seconds to disappear if you click somewhere off the bubble. If you click on the button, it's immediate. Just increase the interval value.

phantom007
07-21-2009, 12:56 PM
i tried it but no dice

fside
07-21-2009, 02:02 PM
i tried it but no dice

I just tried it myself. Sure it worked - but it didn't.

The only thing that works, at least as I'm using it - is the title, as I said before. You can delay that. But what can you really put in a title attribute?

Like this:



<div id="1" style="width:100px; border:1px solid #000000" title="hover here">hover</div>

and then:

$('#1').bt({
hoverIntentOpts: {
interval: 2000,
timeout: 2000
}
});


So there's a long delay. But . . it's not 'content', it's a title.

The example Robbins shows is just for a title. Maybe that's all it works with. Maybe contact him, and ask, as I suggested. See what Robbins or Cherne have to say. I mean, if title is the default, I don't see why HTML 'content' couldn't also be used here. Their documentation is just a bit spotty. Initial hover times seem inconsistent, as well. Don't know if you're seeing the same.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum