Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jQuery mobile anchor link on the same page

//jQuery anchor link on the same page
$('#menu a[href^="#"]').on(click, function (event) {
    var target = $(this.getAttribute('href'));
 
    if (target.length) {
        event.preventDefault();
        closeMenu();
        $('html, body').animate({
            scrollTop: target.offset().top
        }, 1000)
    }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: function titleCase 
Javascript :: withrouter in react-router v6 
Javascript :: errors thrown inside asynchronous functions will act like uncaught errors 
Javascript :: load limited data and search data from all in angularjs 
Javascript :: onclick readmore and readless react js 
Javascript :: PostManDocs 
Javascript :: pnpm tailwind react 
Javascript :: How to Loop Through an Array with a While Loop in JavaScript 
Javascript :: JSON of first block in cryptocurrency blockchain 
Javascript :: &quot in json 
Javascript :: discord.js create a private channel 
Javascript :: Backbone Sync And Fetch 
Javascript :: computed properties in react 
Javascript :: create number format excel react native 
Javascript :: remove parent element jquery 
Javascript :: javascript asynchronous function list 
Javascript :: js function to print word starts with vowels of given string 
Javascript :: javascript array cheatsheet 
Javascript :: moment add 
Javascript :: jwt_access_secret generator 
Javascript :: nextjs apollo client 
Javascript :: moment js get last week start and end date 
Javascript :: js pick last element of array 
Javascript :: Accessing HTML attributes in DOM 
Javascript :: clear input field react 
Javascript :: javascript Access Set Elements 
Javascript :: JavaScript Code Blocks 
Javascript :: jQuery - Set 
Javascript :: prevent js execution in elementor 
Javascript :: node add dependency 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =