Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

waypoint cdn

//waypoint cdn 
 <script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js"></script>

//DOWN CODE IS STICKY MENU FOR
//(WHEN I NEED SCROLL ONE SECTION AFTER THEN TIGER STICKY MENU)

//js code
$("#service").waypoint(function (direction) {
		if (direction == 'down') {
			$('nav').addClass('sticky');
		} else {
			$('nav').removeClass('sticky');
		}
	});

// css code
.sticky {
	position: fixed;
	top: 0;
	left: 0;
	background: #834a8f;
	width: 100%;
	z-index: 1;
}

//CUSTOM CODE JS (WITHOUT PLUGIN)
//STICKY MENU JS CODE
$(window).scroll(function () {
		if ($(this).scrollTop() > 650) {
			$('nav').addClass('sticky');
		} else {
			$('nav').removeClass('sticky');
		}
	});
Comment

PREVIOUS NEXT
Code Example
Javascript :: react absolute path 
Javascript :: js get current date 
Javascript :: change placeholder javascript 
Javascript :: jquery element distance from top of window 
Javascript :: telegraf js sendmessage 
Javascript :: img onerror 
Javascript :: get time from a date time in jquery 
Javascript :: activate treeview menu in adminlte 3.0.2 treeview-menu open 
Javascript :: learn gram js 
Javascript :: switch browser to fullscreen 
Javascript :: protractor get active element 
Javascript :: string to accept two characters after point javascript 
Javascript :: jquery set multiple css properties 
Javascript :: convert text to binary javascript 
Javascript :: daterangepicker change 
Javascript :: react navigation transparent header 
Javascript :: javascript close current tab 
Javascript :: Javascript remove array item by value 
Javascript :: Sort an array using setTimeout function 
Javascript :: Inject Javascript Function not working in Android React Native WebView but work fine in iOS React Native 
Javascript :: python phantomjs current url 
Javascript :: react native navigation back 
Javascript :: how to remove angular package 
Javascript :: nodejs powershell process env 
Javascript :: how to get current year in javascript 
Javascript :: how to revers bulain in js 
Javascript :: jquery give control focus 
Javascript :: remove file from input type file jquery 
Javascript :: change version of node mac 
Javascript :: ipv4 to int32 js 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =