Advertisement
Guest User

Untitled

a guest
Jan 12th, 2011
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function() {
  2.     $("#event_menu").hide();
  3.     $("#about_menu").hide();
  4.     $("#menu a#event").click(function() {
  5.         $("#about_menu").slideUp('slow', function () {
  6.             $("#event_menu").slideToggle('slow');
  7.         });
  8.     });
  9.     $("#menu a#about").click(function() {
  10.         $("#event_menu").slideUp('slow', function () {
  11.             $("#about_menu").slideToggle('slow');
  12.         });
  13.     });
  14.    
  15.    
  16.    
  17.    
  18.         // Check for hash value in URL
  19.     var hash = window.location.hash.substr(1);
  20.     var href = $('.submenu li a').each(function(){
  21.         var href = $(this).attr('href');
  22.         if(hash==href.substr(0,href.length-5)){
  23.             var toLoad = hash+'.html #content';
  24.             $('#content').load(toLoad);
  25.         }
  26.     });
  27.  
  28.     $('.submenu li a').click(function(){
  29.  
  30.         var toLoad = $(this).attr('href')+' #content';
  31.         $('#content').slideUp('fast',loadContent);
  32.         window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
  33.         function loadContent() {
  34.             $('#content').load(toLoad,function(){
  35.                 $('#content').slideDown('normal');
  36.             });
  37.         }
  38.         return false;
  39.  
  40.     });
  41.    
  42.    
  43.    
  44.    
  45. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement