Tuesday, July 31, 2012

jquery – Running Javascript after CSS is fully loaded



I have some code that depends on the css being loaded.


I load css on the header before I load the javascripts on the footer




$(window).load
bar_position = $(\'body\').height() - 38 #38 is the size of the bar
width = $(\'body\').width()
console.log(bar_position)
if (width &lt= 480) #480 is the mobile width
console.log(\"Entered\");
$(\'#accounts-bar\').css(\"top\", bar_position)

return


I tried $(window).ready, $(window).load but all of them fail






Rating: 2 out of 5 based on 4 ratings



The post jquery – Running Javascript after CSS is fully loaded appeared first on Javascript ASK.






via Javascript ASK http://javascriptask.phpfogapp.com/jquery-running-javascript-after-css-is-fully-loaded.html

No comments:

Post a Comment