Activity Stream
48,167 MEMBERS
6782 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 10 of 10
  1.     
    #1
    Member
    Website's:
    maxneeds.info

    Question on first mouseover ?

    Is there a way to make mouseover function for one time only (no repeating of the function in next mouseover's)?
    Porsche_maniak Reviewed by Porsche_maniak on . on first mouseover ? Is there a way to make mouseover function for one time only (no repeating of the function in next mouseover's)? Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Respected Developer
    In the head part do something like
    Code: 
    var isFirstMouseOver = true;
    
    function mouseOverHandler(elm)
    {
        if (isFirstMouseOver)
        {
            isFirstMouseOver = false;
            // do stuff...
        }
        else
        {
            // not the 1st time...
        }
    }
    And then in the HTML
    Code: 
    <a href="#" onmouseover="mouseOverHandler(this); return false;">foo</a>

  4.     
    #3
    Member
    Seifer (cysforum owner) had given me that code. I don't know where it is now. Try Hyperz' code

  5.     
    #4
    Member
    Website's:
    maxneeds.info
    @Hyperz

    Works perfect !
    TNX

  6.     
    #5
    Member
    or, how about...

    Code: 
    <a href="" onmouseover="alert('Hello!');this.onmouseover='';">Link</a>

  7.     
    #6
    Member
    Quote Originally Posted by el_jentel1 View Post
    or, how about...

    Code: 
    <a href="" onmouseover="alert('Hello!');this.onmouseover='';">Link</a>
    That will create a mouse-over effect indeed, but it will work the second and third etc time too. And TS specifically asked for a snippet that works only on the first mouse-over event

    Otherwise, it works yes

  8.     
    #7
    ლ(ಠ益ಠლ)
    Website's:
    extremecoderz.com
    does onMouseOver validate?

  9.     
    #8
    Respected Developer
    Elj's example should work too. Although I'm not 100% sure if all browser like that sort of tricks. But IMO code should be self explaining. Like mine.

    * Hyperz' ego just went 1UP

  10.     
    #9
    Member
    Website's:
    ultratechhost.com
    Code: 
    <a href=""><img src="images.png" alt="anything" onmouseover="this.src='image.png';" onmouseout="this.src='images.png';" /></a>

  11.     
    #10
    Member
    Sunil he doesn,t needs a Rollover Button

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

BE SOCIAL