Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($){
- $(document).ready(function(){
- $(document).on('click', '.jn-anchor', function(event){
- var url = $('.page-home').attr('data-base-url');
- var anchor = $(this).data('href','/test/test251');
- event.preventDefault();
- if(url){
- alert('Estoy en el home');
- }else {
- alert('No estoy en el home ');
- window.location.href = anchor;
- if(!$(anchor).length) return;
- var duration = el.data('duration');
- if (duration == null) duration = 500;
- var easing = el.data('easing');
- if (easing == null) easing = 'swing';
- var top = $(anchor).offset().top;
- }
- // Transition
- $('html, body').animate({
- scrollTop: top
- }, duration, easing);
- });
- });
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement