0

I am doing a simple hover scrollbar project. I want to change the height of thumb when someone change the contents in html tag by prepend(),append(),html()..etc. how can I do this? I googled it and found answers like

$('.class').html('value').trigger(somefunction())

But it is not the answer. Because I am not the developer of other js codes. I want to do this with only my script file.

here is my project :- https://github.com/rameshkithsiri/hoverscroll

1 Answers1

1

Here is way of doing so , you can use DOMSubtreeModified events. But look out It before using it.

$("body").on('DOMSubtreeModified', ".myCLASS", function() {
   alert($(this).html());
});
setTimeout(function(){ $(".myCLASS").html("my Test") }, 3000);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>


<div class="myCLASS"></div>
manikant gautam
  • 3,521
  • 1
  • 17
  • 27