Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 1.16 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jQuery(document).ready(function($) {
  2.        
  3.         var $mainContent = $("#container"),
  4.         siteUrl = "http://" + top.location.host.toString(),
  5.         url = '';
  6.        
  7.     $(document).delegate("a[href^='"+siteUrl+"']:not([href*=/wp-admin/]):not([href*=/wp-login.php]):not([href$=/feed/])", "click", function() {
  8.         location.hash = this.pathname;
  9.         return false;
  10.     });
  11.  
  12.     $("#searchform").submit(function(e) {
  13.         location.hash = '?s=' + $("#s").val();
  14.         e.preventDefault();
  15.     });
  16.        
  17.     $(window).bind('hashchange', function(){
  18.         url = window.location.hash.substring(1);
  19.         if (!url) {
  20.             return;
  21.         }
  22.         url = url + " #content";
  23.         $mainContent.html('<p>...</>').load(url, function() {
  24.        
  25.         });
  26.     });
  27.    
  28.     $(window).trigger('hashchange');
  29.  
  30.  
  31.         $(".btn").click(function(){
  32.                 // Haal huidige selected class weg
  33.                 $(".selected").removeClass("selected");
  34.                 // Selecteer de section van deze btn
  35.                 $(this).parents("section").addClass("selected");
  36.                 // Plaats de content container in de geselecteerde section.
  37.                 $("#container").appendTo( $('.selected'));                     
  38.         });
  39.        
  40.  
  41. });