Scroll Smooth J-query Custom Code:-
For Online path download file link below:-
HTML
<!-- Navigation Section Past IDS as per below ul li According..-->
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><i class="fa fa-home"></i></a></li>
<li><a href="#overview">Why Mahalaxmi</a></li>
<li><a href="#highlight">Amenities</a></li>
<li><a href="#location">Location</a></li>
<li><a href="#price-list">Price List</a></li>
<li><a href="#gallery">Floor Plan</a></li>
<li><a href="#other-project">Piramal Other Project</a></li>
<li><a href="http://piramalmahalakshmi.info/#contact">Contact Us</a></li>
</ul>
<!--IDS Apply with Section Wise Below Code- ->
<div class="main-section" id="overview" tabindex="-1"></div>
<div class="main-section bg-change" id="highlight" tabindex="-1"></div>
<!--remening section same as uper code online id name change-->
JS:-
<script type="text/javascript">
$(document).ready(function(){
setTimeout(function () {
// Do something after 1 second
$(".modal-content").fadeIn();
}, 1000);
$('.close').click(function(){
$('.modal-content').fadeOut();
});
// phoneform js
setTimeout(function () {
// Do something after 1 second
});
$(".enq-left").click(function() {
$(".form-box").addClass('form_active');
});
$(".close_btn").on('click', function() {
$(".form-box").removeClass('form_active');
});
// Select all links with hashes
$('a[href*="#"]')
// Remove links that don't actually link to anything
.not('[href="#"]')
.not('[href="#0"]')
.click(function(event) {
// On-page links
if (
location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '')
&&
location.hostname == this.hostname
) {
// Figure out element to scroll to
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
// Does a scroll target exist?
if (target.length) {
// Only prevent default if animation is actually gonna happen
event.preventDefault();
$('html, body').animate({
scrollTop: target.offset().top
}, 1000, function() {
// Callback after animation
// Must change focus!
var $target = $(target);
$target.focus();
if ($target.is(":focus")) { // Checking if the target was focused
return false;
} else {
$target.attr('tabindex','-1'); // Adding tabindex for elements not focusable
$target.focus(); // Set focus again
};
});
}
}
});
});
</script>
very nice code...... and i like it this code......
ReplyDeletethanks a lot..
Delete