Connect .html(), .append() and .prepend() to nested element within target

Connect .html(), .append() and .prepend() to nested element within target

Hi All,

is it possible to connect all the methods concerning adding/removing/appending html to an element to a nested element residing in the target?

To give you some background, i'm using a jQuery plugin to enhance a DIV with nice scrollbars. The best one actually adds itself IN the DIV it needs to scroll, this works best if the DIV is removed from the DOM without jQuery knowing this. The only setback is when i use .html(), .append() and such the construction is broken. So i looked at the construction and the scrollbar script wraps the html from the DIV into it's own DIV and then adds to extra DIVS to make a visual scrollbar. When i use .append('#divid .scrollbarwrapper-div') it works, so i would like to add some stuff to the scrollbarscript that when its nesting itself in DIV 'x' it will also automatically port the jQuery methods .html('#x'), .append('#x') and so on to .html('#x .scrollbarwrapper') and .append('#x .scrollbarwrapper').

Ultimately it would create the situation that i can still use the obvious .html() and .append() jQuery syntax and the scrollbar script makes sure in the background that it works.

If i can achieve that my next goal would be that if within the jQuery realm a scroller is added and somewhere someone changes the target DIV it .innerHTML() DOM method the things also stays together.

Is this possible?











    • Topic Participants

    • as