I am trying to create a slideToggle effect in JQuery.
I have a div which is positioned as:
someDiv {
position : absolute;
bottom : 100px;
}
Now when the function ( $("#someDiv").slideToggle(); ) is triggered on click, the div slides UP from bottom rather than showing or dropping down.
I want it to drop normally form TOP while it is positioned as above. How do I do that? I have read that positioning from bottom gives it that effect but could not find a solution anywhere.
Any help would be really appreciated.
You can use a function in combination with the window
resizeevent to dynamically position the div 100px from the bottom using the CSStopproperty so that theslideToggle()acts the way you want like this:CSS
HTML
JS
DEMO HERE
I hope this helps!