Disable Mouse Scroll To Resize Window

Disable Mouse Scroll To Resize Window simply add below script to your site

Continue reading “Disable Mouse Scroll To Resize Window”

Advertisements

Change Navigation Active on Page Scroll

My Navigation

<header>
	<nav>
		<ul>
			<li><a class="active" href="#home">Home</a></li>
			<li><a href="#about">About</a></li>
			<li><a href="#services">Services</a></li>
			<li><a href="#contact">Contact</a></li>
		</ul>
	</nav>
</header>

Continue reading “Change Navigation Active on Page Scroll”

Smoothly Scroll To An Element

First Method Using ID’s

<a href="#div1">Go To Div 1</a>


<div id="div1"></div>

$('a[href^="#"]').on('click', function(event) {
    var target = $( $(this).attr('href') );
    if( target.length ) {
        event.preventDefault();
        $('html, body').animate({
            scrollTop: target.offset().top
        }, 1000);
    }
});

 

Second Method Using Classes

<a href="#" onClick="goToScroll('specificEle')">Go To Div that have class name specficEle</a>


<div class="specificEle"></div>

function goToScroll(e){
    $('html, body').animate({
        scrollTop: $("."+e).offset().top
    }, 1000);
}  

 

See It In Action