Simple question regarding functions in jQuery
Hello guys,
It's my first time here, so hopefully I don't get eaten or something :)
I've ran into a little problem when using resize() function in jQuery as I am trying to call a function after the document loads and later on should window resize occur, but I can't really figure out use jQuery syntax to do the both at the same time within a function. Here's a example:
- $(document).ready(function() {
- doScript();
- $(window).resize(function doScript() {
- // do stuff
- });
- });
So it is possible to give an instance name to this (resize) function and call it just once after the page loads?