![]() You can also hide the scrollbar through CSS to pressurize the user to use mouse wheel. However you can add any extra codes with this too if you want. You just have to enter your targeted DIV name where you want to scroll at targetedDIV. Scroll(scrollContainer, scrollContainer.scrollTop, targetY, 0) Code From: window.smoothScroll = function(target), 1) Smooth Scroll To A Desired Up Or Down DIV After adding those two DIV, add onclick=’smoothScroll(document.getElementById(“ targetedDIV “))’ anywhere where you want to make a button like in image or link Next DIV .After adding this button, just add the below code before tag on you page. First you must have two DIV on your webpage and that should be UP/DOWN so this code will work. 8.) Work On All Platform, Website, Blogger, WordPress. 5.) You Can Scroll X-Axis Through Mouse Click On ScrollBar Only. 4.) It Will Scroll Your Page On Y-Axis Only Through OnClick Anywhere. After seeing this, check out our features of this code and then garb the code and see its editing below.ġ.) Pure JavaScript Code. So without any more preface, here is the live working DEMO URL that can explain you more what we want to desire. It can also easily mix up with your own code and can work with any code without conflicting. Its short and clean with cross browsers compatibility and can be fully customizable. ![]() For this purpose, we got a CODE that we are sharing with you below that have more awesome features as you needed. You can scroll to any portion of page smoothly whether it is up or down onclick on your places button. It has all the effect like of CSS3 as smooth scrolling. So for this purpose, we are here with another awesome and short code that is purely written in JavaScript and compatible to add browsers. So for this, purpose, many are using JQuery and CSS3 that sometime are heavy and sometime are not compatible with old browsers.Īlso if they use anchor links n a single page to scroll through that then it can mess up there URL like adding #DIV1, #DIV2 etc in the URL so that look bad. Many designers are now working on single page website as it is now a trend so to make that more awesome, nearly every are using smooth scrolling to the next DIV on single page site that will be a page.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |