Skip to content

Instantly share code, notes, and snippets.

View hmjobaer's full-sized avatar

Md Jobaer hmjobaer

  • JITSoft LTD
View GitHub Profile
@hmjobaer
hmjobaer / scroll top top button .js
Created October 23, 2019 06:33
Scroll Top Butoon
$(window).scroll(function(){
if ($(this).scrollTop() > 500) {
$('.topscroll').fadeIn();
} else {
$('.topscroll').fadeOut();
}
});
//Click event to scroll to top
$('.topscroll').click(function(){
$('html, body').animate({scrollTop : 0},700);
@hmjobaer
hmjobaer / scroll-smoth.js
Created October 4, 2019 09:24
Smooth scroll to the target location html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<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();
@hmjobaer
hmjobaer / scroll-smoth.js
Created October 4, 2019 09:24
Smooth scroll to the target location html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<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();
@hmjobaer
hmjobaer / url.js
Last active September 29, 2019 19:44
Select specific url part form current link, Use specifc charecter or symbol link(=, -, ?).
var pageURL = document.location.href.split('=').pop();
// Inside the jQuery Structure
$('Select Parent li').hover(function(){
$(this).children('ul').stop(true, false, true).slideToggle(300);
}) ;
@hmjobaer
hmjobaer / scroll-active-menu.js
Created October 6, 2018 17:00
active menu when show section
$(document).ready(function() {
$('a[href*=#]').bind('click', function(e) {
e.preventDefault(); // prevent hard jump, the default behavior
var target = $(this).attr("href"); // Set the target as variable
// perform animated scrolling by getting top-position of target-element and set it as scroll target
$('html, body').stop().animate({
scrollTop: $(target).offset().top
}, 600, function() {
@hmjobaer
hmjobaer / scroll-active-menu.js
Created October 6, 2018 17:00
active menu when show section
$(document).ready(function() {
$('a[href*=#]').bind('click', function(e) {
e.preventDefault(); // prevent hard jump, the default behavior
var target = $(this).attr("href"); // Set the target as variable
// perform animated scrolling by getting top-position of target-element and set it as scroll target
$('html, body').stop().animate({
scrollTop: $(target).offset().top
}, 600, function() {
@hmjobaer
hmjobaer / scroll-active-menu.js
Created October 6, 2018 17:00
active menu when show section
$(document).ready(function() {
$('a[href*=#]').bind('click', function(e) {
e.preventDefault(); // prevent hard jump, the default behavior
var target = $(this).attr("href"); // Set the target as variable
// perform animated scrolling by getting top-position of target-element and set it as scroll target
$('html, body').stop().animate({
scrollTop: $(target).offset().top
}, 600, function() {
// 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(/^\//, '')
// 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(/^\//, '')