Results 1 to 3 of 3

Thread: jquery variables

  1. #1
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default jquery variables

    i seem to be having problems passing in dynamic variables into jquery like this
    Code:
    function scrnSlide(){	
    	var screen_width = document.body.offsetWidth;
    	var screen_height = document.body.offsetHeight;
    	$("#swipeMask").css({width:screen_width, height:screen_height});
    
    };
    any ideas how to make this work?
    thanks

  2. #2
    Join Date
    Jan 2011
    Location
    Beograd
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    if you're using Jquery, why don't you go with $(document).width() and .height() instead of document.body.offsetWidth;

  3. The Following User Says Thank You to algo web dizajn For This Useful Post:

    ggalan (01-06-2011)

  4. #3
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default

    that worked well, thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •