Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Dec 2008
    Posts
    117
    Thanks
    14
    Thanked 0 Times in 0 Posts

    jquery: a bug in safari and chrome - css({overflow:'auto'})

    Hi,
    I set the body tag to overflow:hidden when the page is ready.
    $('body').css({overflow:'hidden'});

    and i try to set the overflow to 'auto' when the 'show more' is clicked.
    $('body').css({overflow:'auto'});

    it works fine in firefox and IE 8. but it wont work on safari and chrome - show the scroll bar when the show more' is clicked.

    it only works in safari and chrome if I set it to,
    $('body').css({overflowY:'scroll'});

    but i only want to show the scroll when there are content is overflowed only.

    how can i fix this browser bugs?

    here are the links to look at,
    http://lauthiamkok.net/tmp/projects/part/
    view-source:http://lauthiamkok.net/tmp/projects/part/js/core.js

    many thanks,
    Lau

  • #2
    Regular Coder Iszak's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Western Australia
    Posts
    332
    Thanks
    2
    Thanked 58 Times in 57 Posts
    I do not have the problem you specify, when there is overflow: auto; set to the body but does not overflow Google Chrome does not show the scroll bar, only until there is overflow does it show.

    Although I do notice that when you set overflow: hidden; in Google Chrome it set two properties (overflow-x and overflow-y) as opposed to simply overflow which may be jQuery or simply how it manipulates overflow. As seen here (www.grabup.com/uploads/c20a340123fe.png)

    I should also mention this really isn't a bug.


  •  

    Posting Permissions

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