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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:32:28+00:00 2026-06-10T15:32:28+00:00

http://blog.jeremymartin.name/2008/02/building-your-first-jquery-plugin-that.html Based on this tutorial, I created my first plugin and made some modifications.

  • 0

http://blog.jeremymartin.name/2008/02/building-your-first-jquery-plugin-that.html

Based on this tutorial, I created my first plugin and made some modifications.
But, the plugin doesn’t work for dynamically generated content when I load new content on the site.

I have no idea how to go about making it live. The events are already using .on but the building of the pluggin doesn’t work.

Here is the jsFiddle: http://jsfiddle.net/bT4dH/13/

I know I could call the plugin everytime I add content dynamically, but as that gets messy very quickly, I would prefer to avoid it, and integrate it directly into the plugin.

I was starting to try this:

$(document).on('DOMNodeInserted', function (e) {
    if (e.target.classname === 'JS_postShrinker') {
         $(e.target).shrinker(options);
    }
});

But it doesn’t work

UPDATE

Please ignore the DOMNodeInserted, I was just trying it. How do people in general make plugins live? I have the same problem with:

  • http://code.google.com/p/jquery-watermark/
  • http://unwrongest.com/projects/elastic/
  • And many more…
  • 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-10T15:32:29+00:00Added an answer on June 10, 2026 at 3:32 pm

    You can simply make it live by using .on() in a bit different way, with delegation. The documentation explains it in detail.

    $(closeParent).on(event, selectorForElement, handler);

    All you have to do is to choose a parent that you surely know will be part of the DOM when you attach the handler. In the worst case, you can choose body.

    Then you attach the handler on this element, and specify the selector for the child elements (that can be inserted into the DOM at any time). The handler will run whenever the event is fired on any of the child elements matching the selector. This method makes use of event bubbling in a very clever way.

    EDIT: Of course this will only work for event handling. If you need to initialize your elements when they are added to the DOM (resizing, decorating, etc.), you better call the plugin every time this happens. This is how most plugins work. The DOMNodeInserted event is not cross-browser and deprecated, like all Mutation events, so you should not use it.

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

Sidebar

Related Questions

I´m currently trying to add the feature that is discussed here: http://blog.bmn.name/2008/03/jquery-fadeinfadeout-ie-cleartype-glitch/ A glitch
I've implemented this 'locksubmit' plugin http://blog.leenix.co.uk/2009/09/jquery-plugin-locksubmit-stop-submit.html where it changes the display state of the
In this tut http://blog.lyxite.com/2008/01/compile-objective-c-programs-using-gcc.html it says that after installing gnustep for windows I can
This is regarding the following jQuery plugin: http://blog.danawoodman.com/jquery-showhide/ I am using jQuery show hide
I used this link http://blog.androgames.net/85/android-accelerometer-tutorial/ to create an accelerometer. But I want that this
http://blog.helpcurenow.org/test/mockups/mar2010/lp.html In the above landing page, I have an offers box that has four
I am currently profiling my node.js application.I found this blog: http://blog.nodejs.org/2012/04/25/profiling-node-js/ that suggests I
I've found a little tutorial that would be useful for my game: http://blog.mellenthin.de/archives/2012/02/13/an-one-finger-rotation-gesture-recognizer/ But
From here http://blog.prabir.me/post/Undo-in-Git.aspx , it said This undo’s your commit and also resets your
I follow the tutorial here http://blog.bdoughan.com/2011/05/jaxb-and-joda-time-dates-and-times.html to use joda DateTime with jersey. But I

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.