SCROLL TO BOTTOM ON BUTTON CLICK

HTML
—-
LT div id=”main” GT
LT div class=”container-fluid” id=”subParentDiv” GT
LT /div GT
LT /div GT

JAVA SCRIPT
———–
function checkScroll(){
scroll_to($(“#main”), $(“#subParentDiv”));
}

function scroll_to(base, target){
base.animate(
{
scrollTop:target.height()
},1000
);
}

EXPLANATION
———–
Call the checkScroll() function on your any button event.
the LT div id=”#main ” GT LT /div GT will have the scroll bar to set when it exceeds the limited height.

scrollTop:target.height() : i will take height of the target element and will scroll that much from the top side.
1000: i m the time duration in milli seconds to scroll the scroll bar.

Advertisements

About rajkirpal

i am a software engineer. and i have decent knowledge about java technologies like ANDROID, Servlet, Jsp, Struts, Hibernet, Spring, J2ME, Java Script, Ajax, JQuery, CSS. Further i am Preparing Easy understandable materials/documents upon the same java technologies and developing project in core java , advanced java and j2me , ANDROID as per the requirements Also designing the web sites and logos Thank You.
This entry was posted in JavaScript / CSS, JQuery. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s