| Current Path : /home/happyrenas/happy-rentals.com/js/ |
Linux webd005.cluster105.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 |
| Current File : /home/happyrenas/happy-rentals.com/js/smoothscroll.js |
(function($){
$.fn.juizScrollTo = function(speed){
if(!speed) var speed = 'slow';
return this.each(function(){
$(this).click(function(){
var goscroll = false;
var the_hash = $(this).attr("href");
var regex = new RegExp("(.*)\#(.*)","gi");
var the_element = '';
if(the_hash.match("\#(.+)")) {
the_hash = the_hash.replace(regex,"$2");
if($("#"+the_hash).length>0) {
the_element = "#" + the_hash;
goscroll = true;
}
else if($("a[name=" + the_hash + "]").length>0) {
the_element = "a[name=" + the_hash + "]";
goscroll = true;
}
if(goscroll) {
var container = 'html';
if ($.browser.webkit) container = 'body';
$(container).animate({
scrollTop:$(the_element).offset().top
}, speed);
return false;
}
}
});
});
};
})(jQuery)
$('a[href^="#"]').juizScrollTo('slow');