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 8811735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:26:19+00:00 2026-06-14T03:26:19+00:00

In jQuery there is a feature to use $(document).on(…) to assign a event also

  • 0

In jQuery there is a feature to use $(document).on(...) to assign a event also to the newly added elements in the html for example after ajax request.

Can you give an example of using this with a custom defined function/plugin for example hoverpulse.

Other issue I am facing is that it is also expecting some values to be passed to that function which is returned by hoverpulse while calling it on the selector.

  $(document).ready(function(){  
    $('div.thumb img').hoverpulse({ size: 40, speed: 400 });   
  });

How to pass the options of such function through on() method of jQuery? Note that the options are not to be passed to the handler but the function hoverpulse itself.

  • 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-14T03:26:20+00:00Added an answer on June 14, 2026 at 3:26 am

    The .on() method is used to assign event handlers, it doesn’t make sense to be thinking about using it to apply a plugin.

    “If I just use $(selector).hoverpulse() will it reassign the same function…therefore executing the effect twice in some case?”

    Yes, if you use the same selector it will apply the plugin to all of the elements that match the selector at that time, including elements that were already done earlier. For some plugins that might not matter much, but for others it will. I’m not familiar with .hoverpulse() specifically, but conceivably it might execute the effect multiple times on the same element if you called .hoverpulse() multiple times for that element.

    The first workaround that comes to mind is to add a class to elements that have already had the plugin applied, then next time limit yourself to elements that don’t have that class:

    $('div.thumb img').not(".HPapplied")
                      .hoverpulse({ size: 40, speed: 400 })
                      .addClass("HPapplied"‌​);
    

    Given that you (presumably) need to apply the same options both in document ready and in your Ajax success callback you might like to put the above statement into a function and then call that function from both places. That way if you need to change one of the options you only have to change it in one place.

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

Sidebar

Related Questions

I am trying to use the jquery UI tab feature from the link http://jqueryui.com/demos/tabs/manipulation.html
jQuery has the very cool feature/method .data, I wonder if there is a way
Is there such jQuery plugin? More specific: I want to use some elegant and
Is there any way to use both the jquery and scriptaculous js files together?
I use JQuery layout feature to build skeleton of my app. Layout has north-panel
I have two pages, p1.html and p2.html with jQuery Mobile. There is some links
I would like use .appendTo() on different elements determined by a function. For example,
In jQuery is there a callback that can be used when an ajax request
Is there a jQuery type function to solve the problem of walking through nested
Is there a jQuery plugin or effect that will create an overlay/lightbox effect around

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.