Posts

Showing posts from September, 2019

php code

<ul> <li class="<?php if($page=='home'){echo 'active-new';}?>"><a href="./">Home</a></li> <li class="<?php if($page=='about'){echo 'active-new';}?>"><a href="about.php">About</a></li> <li class="<?php if($page=='prodcuts'){echo 'active-new';}?>"><a href="product.php">Products</a></li> <li class="<?php if($page=='gallery'){echo 'active-new';}?>"><a href="gallery.php">Gallery</a></li> <li class="<?php if($page=='contact'){echo 'active-new';}?>"><a href="contact.php">Contact</a></li> </ul> <?php $page = 'prodcuts'; require_once "includes/header.php" ?> <?php $page = '6'; require_once ...

One Page Scroll

//One Page Script// $(document).ready(function(){ // Add smooth scrolling to all links $("a").on('click', function(event) { // Make sure this.hash has a value before overriding default behavior if (this.hash !== "") { // Prevent default anchor click behavior event.preventDefault(); // Store hash var hash = this.hash; // Using jQuery's animate() method to add smooth page scroll // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area $('html, body').animate({ scrollTop: $(hash).offset().top - 9 }, 800, function(){ // Add hash (#) to URL when done scrolling (default click behavior) window.location.hash = hash; }); } // End if }); });