jquery width() with newly generated element -


when use following :

div = '<div class="tag-tooltip" id="tooltip_view_1">first item</div>'; $('#products').append(div);  var tooltip_width = $('#tooltip_view_1').width();  var tooltip_height = $('#tooltip_view_1').height(); 

the tooltip_height gives correct value, while tooltip_width returns 0. idea why happening , should width of newly created element?

just i've solved problem - appears css property : text-indent affecting visibility of element. had set negative value , once removed property altogether - started working fine.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -