Advertisement
Guest User

Untitled

a guest
Feb 1st, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function(){
  2. var trigger = false;
  3. var isLoaded = false;
  4.  
  5.     $("#getContent").click(function(){
  6.  
  7.     trigger = 1 - trigger;
  8.    
  9.     if (trigger) {
  10.         $("#mode").hide();
  11.  
  12.     if (isLoaded == false)  {
  13.  
  14.         $("#divContent").show(function(){
  15.    
  16.         $.ajax({
  17.             url: "load.php",
  18.             cache: false,
  19.         beforeSend: function() {
  20.             $('#divContent').html('Получаем контент');
  21.         },
  22.         success: function(html){
  23.             $("#divContent").html(html);
  24.             isLoaded = true;
  25.         }
  26.  
  27.         });
  28.         return false;
  29.         });
  30.     } else {
  31.  
  32.     $("#divContent").show();
  33.     }
  34.  
  35.     } else {
  36.         $("#divContent").hide();
  37.         $("#mode").show();
  38.     }
  39.  
  40.         return false;
  41.     });
  42. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement