/    Sign up×
Community /Pin to ProfileBookmark

counting the times a mouseover is activated

I have several show/hide functions on several mouseovers/outs on one page.
Now what I want to do is have one particular mouseover/out showing/hiding a different div with each time the visitor activates it, up to five times and then return to the first div and so on.

Does anyone know how to do this?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@LeruraOct 09.2005 — Initialize a Counter eg. var MouseoverCount = 0;

and a function to run on each mouseover

start the function with

[COLOR=Red]MouseoverCount++;

doSelect=MouseoverCount%5;

[/COLOR]


then you cant use doSelect to determine what divs to change;
Copy linkTweet thisAlerts:
@iop_qwertyauthorOct 09.2005 — I think I understand, but since I am no expert at writing a script - I usually fiddle around with already written scripts - perhaps you can show me a basic script with this counter, please?

I sure hope so, ?

And wouldn't this effect all mouseovers on the page in stead of just the one?
×

Success!

Help @iop_qwerty 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...