Javascript function to enable a disabled horizontal scroll on browser resize

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eliteflyerteam
    New Member
    • Mar 2010
    • 1

    Javascript function to enable a disabled horizontal scroll on browser resize

    i was looking for advice on a javascript function - i have horizontal scroll bars disabled using, <body style="overflow-x:hidden;"> but i want to create a function so that when i resize the browser the horizontal scroll bar is enabled, but turns off again when full screen is back. anyone give me a hand please!?
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    you might set the style dynamically ... just retrieve the body node in a function and set the style property like:

    Code:
    document.getElementsByTagName('body')[0].style['propertyName'] = 'whatever_style_you_want';
    replace propertyname with the css-property you want to set ...

    Comment

    Working...