iamjpg / Ez-Background-Resize

Resizable full-browser background image using jQuery. Implementation requires no CSS.
http://johnpatrickgiven.com/jquery/background-resize/
89 stars 32 forks source link

Script should not set body 'overflow' to a static value #12

Open bcollin opened 11 years ago

bcollin commented 11 years ago

At the end of the script it says:

// Allow scrolling again $("body").css({ "overflow":"auto" });

The script author ignores the initial setting the web page author selected and overwrites it. Worse, in the comment the script author assumes that this is what the web page author meant.

The script should instead save the initial value to a variable and restore from there.

This might be problematic where browsers do not allow you to read the initial value. An option then could be to allow the user to pass the value as an argument. The default should then be, in my opinion, CSS's default, i.e. 'visible', not 'auto'.