javascript - How to make jQuery script refresh itself? -


explanation: ajax load content div "content" without refreshing page. if div "content" longer 300px - hide "soc_menu_l". script runs absolutely ok on page's refresh: if try update div's height without refreshing page - nothing happens. check heights of div in mozilla's inspector - height changed, script not react it. how can make script "watch" height continuously , infinitely?

$(function () {     if ($('#content').height() > 300) {         $('.soc_menu_l').hide();     } }); 

or maybe should call script each time after "content"-div loaded?

option 1 add event listener:

$('#change1').click(function() {   $('#content').css({"height":"600px"});    $(window).fireevent('change1'); });  $(window).addeventlistener('change1', function() {   if($('#content').height() > 300){     $('.soc_menu_l').hide();     } }); 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -