Showing posts with label anchor. Show all posts
Showing posts with label anchor. Show all posts
Thursday, September 14, 2023
How to add additional class to WordPress navbar anchors
function add_additional_class_on_a($classes, $item, $args)
Wednesday, March 29, 2023
jQuery to smoothly scroll page
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>$(document).ready(function(){
$("a").on('click', function(event) {
if (this.hash !== "") {
event.preventDefault();
var hash = this.hash;
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800, function(){
window.location.hash = hash;
});
}
});
});
</script>
</script>
Subscribe to:
Comments (Atom)
7 Must-Have WordPress Plugins to Boost Your Website in 2026
Want to make your WordPress site faster, smarter, and more powerful? Plugins are the secret weapon that can transform a basic blog into a pr...
-
CSS tricks to show or hide horizontal and vertical scroll bar Sometimes we need to add scroll bar to a div or span whenever ...
-
An API key is used by a lot of Web API to provide a form of access control. The key usually is linked to the identity of the API user as w...