/    Sign up×
Community /Pin to ProfileBookmark

Time Delay Mouseover Link?

Does anyone know where I can find a script that will create a timed delay on a mouseover link? I need something that will take my visitors to a new URL after a certain period of time when they have moved their mouse over a particular portion of my intro page. I’ve found scripts that perform these two functions seperately, but nothing that would cover both (unless there would happen to be a way that I could combine the two scripts). Thank you in advance for any advice that might be usefull . . . ~Maxx

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@NicodemasFeb 03.2003 — Depending on what it is that you need the user to mouseover... I'll just provide a sample that you can place wherever you need it, k?

<SCRIPT LANGUAGE="javascript">

<!-- THE JAVASCRIPT NEEDED TO FUNCTION

function timer(){

setTimeout("golink()",3000);

}

function golink(){

parent.location = "http://www.yahoo.com";

}

</SCRIPT>

-->

<!-- PLACE THIS ON THE OBJECT THAT NEEDS THE MOUSEOVER-->

onMouseover="timer()"
Copy linkTweet thisAlerts:
@MaxxauthorFeb 03.2003 — Thank you Rob! I'll give this one a try. The fact is that the mouseover link is actually going to be the whole page. I have a basic slide show applet running as an intro for my sight, and I need visitors to be taken to the next page after the slide show ends without having to click on anything. So I'm going to make the link the entire page and assume that my visitors mouse will have entered the browser at some point after the slide show starts. That's what I'm hoping for any way. We'll see. Thanx again . . . ~Maxx
Copy linkTweet thisAlerts:
@AdamGundryFeb 03.2003 — In that case, you could put a setTimeout in the body's onLoad event handler, so the mouseover is not required.

Adam
Copy linkTweet thisAlerts:
@MaxxauthorFeb 03.2003 — That sounds a lot easier and a bit less messy. How do I go about doing this Adam?
Copy linkTweet thisAlerts:
@NicodemasFeb 04.2003 — Maxx, read your post about the time crunch, hope this helps.

The above example I included (the onMouseover="timer()") would be changed to something different.

In your pages's <BODY> tag, you could put this:

<BODY onLoad="setTimeout('golink()',3000)">


--------------------------------------------------------------


I sorta went back and revamped the function. Made it reusable by different things on your page. You can try it if you want.


[B]New Script[/B]

<SCRIPT LANGUAGE="javascript">

<!-- THE JAVASCRIPT NEEDED TO FUNCTION

function golink(url){

parent.location = url;

}

</SCRIPT>


[B]New <BODY> tag[/B]

<BODY onLoad=setTimeout('golink("http://www.ebay.com")',3000)>

[B]Explanation[/B]

For each object on your page that you want an onMouseover event for, you simply add the [I]onMouseover=setTimeout('golink("whatever_url_you_want_to_go_to")',3000)[/I] to the tag. The 3000 is the number of milliseconds you want to wait until the browser executes golink(). So, 4000 would be 4 seconds.. 10000 would be 10 seconds.. etc...

Hope this helps..
Copy linkTweet thisAlerts:
@MaxxauthorFeb 04.2003 — You are a genious and a saint Rob! I especially appreciate the thorough explanation, as I hope to someday sit down and at least figure out the basics of scripting. At any rate - I have no doubt that this will work quite well. Many thanx! ~Maxx
×

Success!

Help @Maxx spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...