|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to get browser width when resized
When I resize my browser, on the <body> tag, how could I call a function and return the current browser width ?
|
|
#2
|
||||
|
||||
|
Code:
<script>
window.onresize = myResize;
function myResize() {
if (document.all)
{alert(document.body.clientWidth);}
else
{alert(window.innerWidth);}
}
</script>
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|