I cant get this little script to work , i cant figure out whats wrong so ill pay some one to either make one that does work or edit the one i have . Basically im looking to have a jquery code to hide a div with certain screen resolutions, So if the visitors window size is less than 1025 it will hide the div. Please NOTE , I do not want to use CSS3 media queries as they are not fully browser compatible, this needs to work on all browsers. This is the script i currently have which i cant get working : <script type="text/javascript"> $(document).ready(function() if ((screen.width>1024)) { // if screen size is 1025px wide or larger $(".mydiv").css('display', 'block'); // you can also use $(".yourClass").hide(); } elseif ((screen.width<=1024)) { // if screen size width is less than 1024px $(".mydiv").css('display', 'none'); // here you can also use show(); } }); </script> Code (markup): Obviously this needs to be rewritten for document width and not screen width so it works just by resizing the browser window.