Turn it into a function
Set up your function before (document).ready, then call it as required - (document).ready or window resize.
<script type="text/javascript"> function functionName() { // Jquery stuff goes in here } $(document).ready( function() { functionName(); }); window.onresize = function(event) { functionName(); } </script>








