Buying Jquery Help needed , need ASAP

Discussion in 'Programming' started by Rivmedia, Mar 17, 2012.

  1. #1
    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.
     
    Rivmedia, Mar 17, 2012 IP
  2. biiccs

    biiccs Member

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    Hello. I can help you with this. :)

    Edited: I now have the solution.
     
    biiccs, Mar 17, 2012 IP