I’ve this code:
<script>
$(document).ready(function larg(){
var larghezza = $(document).width();
$("p.width").text("The width for the " + larghezza +
" is px.");
});
$(window).resize(function() {
larg();
});
</script>
I would like to call the function “larg” on window resize, but it doesn’t work..
How to do that??
Thanks
You can’t declare functions that way, use it like this.
EDIT: changed code a bit, thanks commenters