Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Ajax loader
- jQuery(document).ready(function($) {
- var $contentLoader = $("#display"),
- siteUrl = "http://" + top.location.host.toString(),
- url = '';
- $(document).delegate("a[href^='" + siteUrl + "']:not([href*='/wp-admin/']):not([href*='/blog/']):not([href*='/tag/']):not([href*='/wp-login.php']):not([href$='/feed/']):not([href*='/vs/index.php']):not([href*='/#/'])", "click", function() {
- location.hash = this.pathname;
- return false;
- });
- $("#searchform").submit(function(e) {
- location.hash = '?s=' + $("#s").val();
- e.preventDefault();
- });
- $(window).bind('hashchange', function() {
- url = window.location.hash.substring(1);
- if (!url) {
- return;
- }
- url = url + " .load";
- $contentLoader.animate({
- opacity: "0"
- })/* .html('Loading') */.load(url, function() {
- $('html, body').animate({
- scrollTop: 100
- }, 200, function() {
- $("#content_slider").delay(100).slideDown(200, function() {
- $contentLoader.delay(1000).animate({
- opacity: "1"
- }, 250);
- });
- });
- });
- });
- $(window).trigger('hashchange');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement