Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. $('#pageContent').animate({height: 'hide'});
  2. $.ajax({
  3. // ...
  4. success: function() {
  5. $('#pageContent').animate({
  6. height: 'show'
  7. });
  8. }
  9. })
  10.  
  11. ;(function ( $, window, document, undefined ) {
  12. jQuery(document).ready(function($){
  13. $.ajaxSetup({cache:false});
  14. var previousTarget=null;
  15. var column = $('#columns').find('.column');
  16.  
  17. $('#columns').find('a').click(function(e) {
  18. e.preventDefault()
  19. });
  20. column.click(function(){
  21.  
  22.  
  23.  
  24. pageurl = $(this).attr('href');
  25.  
  26. if (!$(this).hasClass('animated')) {
  27. column.not($(this).parent()).dequeue().stop().animate({
  28. width : 'toggle',
  29. opacity: '0.5'
  30. }, 1400, 'linear', function () {
  31. if (pageurl != window.location) {
  32. window.history.pushState({path: pageurl}, '', pageurl);
  33. }
  34. });
  35. }
  36.  
  37. }, function() {
  38.  
  39. if (this==previousTarget) {
  40. return;
  41. } else {
  42. $(this).addClass('animated');
  43. column.not($(this).parent()).dequeue().stop().animate({
  44. width : 'toggle',
  45. opacity: '0.5'
  46. }, 1400, 'linear', function () {
  47. $(this).removeClass('animated').dequeue();
  48. var post_id = $(this).find('a').attr("rel")
  49. $("#page-container").html("loading...");
  50. $("#page-container").load("http://<?php echo $_SERVER[HTTP_HOST]; ?>/ajax/", {id: post_id},function(){
  51. $('#page-container').trigger('create');
  52.  
  53. });
  54. $('.bar').attr('href', '/');
  55. previousTarget=this;
  56. return false;
  57. });
  58. var space = ($(window).width() - 200);
  59. $(this).dequeue().stop().animate({
  60. width:(space/4)
  61. },1400,'linear');
  62. }
  63. });
  64. });
  65. })( jQuery, window, document );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement