Possible slideToggle "scroll" bug - please confirm
I was creating a example for our SDK using jQuery showing dynamic
creating of CSS and .toggle(), like so:
// set height/scroll bar
$("#msgBody").height("200px");
$("#msgBody").css("overflow-y", "scroll");
// add header click to toggle body
$("#msgHeader").click(function() {
$("#msgBody").toggle();
});
In the example, I was showing a progressive example of first showing
how to hide/show a container and then I showed how to change styles.
In this case, to fit the container within the current window viewport
by adding the overflow-y with a fixed height.
Then I threw in how to to do simple animation by changing .toggle()
to .slideToggle().
Well, what happen is that when you toggle to show the container again,
the left sroll bar will disappear.
I narrowed it down to the dynamic CSS usage:
$("#msgBody").css("overflow-y", "scroll");
if I move the CSS property to a style sheet, then it works fine.
I have a demo at
http://beta.winserver.com/public/test/test-slide.wct
showing the display effect. I also have an option css=1
http://beta.winserver.com/public/test/test-slide.wct?css=1
which will preset the overflow-y in a <style> to show it works ok when
overflow is predefined.
--
HLS