Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. /**** SLIDE ****/
  2.  
  3. jQuery('#accordion').bind('accordionactivate', function(event, ui) {
  4.  
  5. var something = jQuery(this).find('.ui-accordion-header-active');
  6.  
  7. // if (something != 'null'){
  8. if (something != 'null'){
  9. ScrollTo(something);
  10. console.log(something);
  11. } else {
  12. console.log('is null');
  13. }
  14.  
  15. });
  16.  
  17.  
  18. function ScrollTo(elem){
  19.  
  20. // var fullw = jQuery( window ).height();
  21.  
  22. var offset = jQuery(elem).offset();
  23.  
  24. // console.log(offset.top);
  25. var newOffset = offset.top - 105;
  26.  
  27. jQuery("body, html").animate({
  28. scrollTop: newOffset
  29. }, 600);
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement