Advertisement
Guest User

Untitled

a guest
May 24th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. //Handle new Toggle Pages
  2. $('#page-nav a').click(function(){
  3. if(!$(this).hasClass('active')){
  4. sectionID = $(this).attr('id');
  5. sectionID = sectionID.replace('-nav','-section');
  6. $('#page-nav a').each(function(){
  7. $(this).removeClass('active');
  8. });
  9. $(this).addClass('active');
  10. $('.toggle-page-section').each(function(){
  11. $(this).hide();
  12. });
  13. $('#'+sectionID).fadeIn(300);
  14. }
  15. });
  16. $(window).load(function(){
  17. var toggleUrl = window.location.href;
  18. var toggleUrlArray = toggleUrl.split('#');
  19. toggleID = '#' + toggleUrlArray[1] + '-nav';
  20. if(toggleUrlArray[1]){
  21. $(toggleID).click();
  22. }
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement