As the Title says, kindly someone explain the use of $ sign in functoin. I am using this code to smooth scroll to ID in WordPress.
When i remove $ sign, code does not work. I have to pass $ in function. kindly refer to image.
Note: This code works without passing $ in function when using in HTML website but does not work in WordPress. Well, that nothing to worry but if some one could explain?
Below is the code:
$(document).ready(function($){
$('.scroll').on('click',function (e) {
e.preventDefault();
var target = this.hash;
var $target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top
}, 900, 'swing', function () {
window.location.hash = target;
});
});
});