Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 18th, 2010 | Syntax: JavaScript | Size: 1.19 KB | Hits: 50 | Expires: Never
Copy text to clipboard
  1.  
  2.  
  3. // execute your scripts when the DOM is ready. this is a good habit
  4. $(document).ready(function() {
  5.  
  6.         // initialize scrollable
  7. var api = $(".project-scroll").scrollable(
  8.         {
  9.                 easing: 'swing',
  10.                 clickable: false,
  11.                 size: '1',
  12.                 items: '#project-wrapper',
  13.                 loop: 'true',
  14.                 prev: '#btn-prev-project',
  15.                 next: '#btn-next-project',
  16.                 keyboard: false,
  17.                 speed: 800
  18.  
  19.                
  20.                 }).navigator({api:true});
  21.  
  22.  
  23.  
  24.         // Starte Funktion vor dem Scrolling zum nächsten Projekt
  25.         api.onBeforeSeek(function() {
  26.                
  27.                 // check if details are visible
  28.                 // when visible -> slideUp()
  29.                 if($('#projekt-details:visible')){
  30.                        
  31.                         $('#projekt-details').slideUp();
  32.        
  33.                         }
  34.        
  35.  
  36.  
  37.         });
  38.  
  39.  
  40.  
  41.         //      var currentIndex = $("#projekt-details").scrollable().getIndex();
  42.        
  43.         // Setup handler on click auf Projekt
  44.         $('.project').bind("click", show_details);
  45.  
  46.  
  47. });
  48.  
  49.  
  50.  
  51. function show_details(which) {
  52.         //  first load current content
  53.         // second slideout the details-container
  54.  
  55.  
  56.         //      var currentIndex = $("#projekt-details").scrollable().getIndex();
  57.  
  58.         currentIndex  = $(this).index();
  59.         alert(currentIndex);
  60.  
  61.  
  62.        
  63.        
  64.         // slide out
  65.         $('#projekt-details').slideToggle();   
  66.         setTimeout("$.scrollTo('500','0');",500);
  67. }