I'm new to jQuery and HTML so probably this is a very dumb question, but I'm just curious if it is possible to change document or window width using jQuery?
Is something like this possible:
$(document).ready(function() {
$(document).width( $(window).width() );
});
Thank you
As I understand it, $(document).width() is read only and will not update the width value. You may have better luck with:
$('body').width( $(window).width() );
Although this would have no effect unless the root element of your document/page was styled to be larger than the viewport (would eliminate horizontal scrolling).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With