Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8225633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:28:41+00:00 2026-06-07T15:28:41+00:00

I have a bunch of dynamically created elements in a page, with different ‘onmouseover’

  • 0

I have a bunch of dynamically created elements in a page, with different ‘onmouseover’ scripts. I’m wondering if I can use a jquery script to automatically replace their onmouseover with an equivalent hoverintent.

Example:

<div onmouseover='dothis()'>Hello</div>
<div onmouseover='dothat()'>World</div>
<div onmouseover='dosomething()'>Seeya</div>

and then with jquery something like ‘for the elements that have a bound ‘onmouseover’ event, replace the call with a hoverintent equivalent.

I’m not even sure it’s possible, how would I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:28:42+00:00Added an answer on June 7, 2026 at 3:28 pm

    Not sure how x-browser compatible this is but works on Chrome.

    I grab all elements with the onmouseover attribute defined. I cycle through each element saving the onmouseover attribute value then erasing the attribute from the element. I then add a new hover event to each element setting a timeout on hover on and clearing it on hover off. When the timeout does execute it runs the saved onmouseover attribute value.

    The default timeout time is 1 second (1000ms).

    jQuery:

    $('[onmouseover]').each(function(){
    
        var _ = $(this).attr('onmouseover');
    
        $(this).attr('onmouseover', '').hover(function(){    
            $(this).data('timeout', setTimeout(function(){ eval(_); },1000));         
        },function(){        
            clearTimeout($(this).data('timeout'));        
        });
    
    });​
    

    Fiddle:

    http://jsfiddle.net/iambriansreed/D3dmv/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of dynamically created *.BAT files. These BAT files are used
i have a table which contains a bunch of dynamically created radio button lists,
So I have a bunch of paragraph elements which are dynamically populated from a
I have some javascript/jquery code that dynamically populates an unordered list with a bunch
I have an MVC app that is basically one page with a bunch of
I am using NHibernate with NHibernate.Linq, and have a bunch of dynamically loading modules
I have an updatepanel, with a bunch of things in that are generated dynamically.
I have a bunch of courses and each course has a different number of
I have the same data model on a bunch of different servers. I want
Currently, I am using headjs to load my javascript files dynamically. I have bunch

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.