Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1.  
  2. (function($){
  3. $(document).ready(function(){
  4.  
  5. $(document).on('click', '.jn-anchor', function(event){
  6. var url = $('.page-home').attr('data-base-url');
  7. var anchor = $(this).data('href','/test/test251');
  8. event.preventDefault();
  9.  
  10. if(url){
  11. alert('Estoy en el home');
  12. }else {
  13. alert('No estoy en el home ');
  14. window.location.href = anchor;
  15. if(!$(anchor).length) return;
  16. var duration = el.data('duration');
  17. if (duration == null) duration = 500;
  18. var easing = el.data('easing');
  19. if (easing == null) easing = 'swing';
  20. var top = $(anchor).offset().top;
  21. }
  22. // Transition
  23. $('html, body').animate({
  24. scrollTop: top
  25. }, duration, easing);
  26. });
  27.  
  28. });
  29. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement