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
Post a Comment