<script> $(document).ready(function larg(){ var larghezza = $(document).width(); $("p.width").text("The width for the " + larghezza + " is px."); }); $(window).resize(function() { larg(); }); </script>
我想在窗口大小调用函数“larg”,但它不工作..怎么做??
谢谢
<script> $(document).ready(larg); $(window).resize(larg); function larg(){ var larghezza = $(document).width(); $("p.width").text("The width for the " + larghezza + " is px."); } </script>
编辑:更改代码一点,谢谢评论者