ÿþ/ *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 s 3 S l i d e r  
 	  
 D e v e l o p p e d   B y :   B o b a n   K a r i ai k   - >   h t t p : / / w w w . s e r i e 3 . i n f o /  
 C S S   H e l p :   M é s z á r o s   R ó b e r t   - >   h t t p : / / w w w . p e r s p e c t i v e d . c o m /  
 V e r s i o n :   1 . 0  
 	  
 C o p y r i g h t :   F e e l   f r e e   t o   r e d i s t r i b u t e   t h e   s c r i p t / m o d i f y   i t ,   a s  
 l o n g   a s   y o u   l e a v e   m y   i n f o s   a t   t h e   t o p .  
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * /  
  
  
 ( f u n c t i o n ( $ )   {  
  
         $ . f n . s 3 S l i d e r   =   f u n c t i o n ( v a r s )   {  
  
                 v a r   e l e m e n t   =   t h i s ;  
                 v a r   t i m e O u t   =   ( v a r s . t i m e O u t   ! =   u n d e f i n e d )   ?   v a r s . t i m e O u t   :   4 0 0 0 ;  
                 v a r   c u r r e n t   =   n u l l ;  
                 v a r   t i m e O u t F n   =   n u l l ;  
                 v a r   f a d e r S t a t   =   t r u e ;  
                 v a r   m O v e r   =   f a l s e ;  
                 v a r   i t e m s   =   $ ( " # "   +   e l e m e n t [ 0 ] . i d   +   " C o n t e n t   . "   +   e l e m e n t [ 0 ] . i d   +   " I m a g e " ) ;  
                 v a r   i t e m s S p a n   =   $ ( " # "   +   e l e m e n t [ 0 ] . i d   +   " C o n t e n t   . "   +   e l e m e n t [ 0 ] . i d   +   " I m a g e   s p a n " ) ;  
  
                 i t e m s . e a c h ( f u n c t i o n ( i )   {  
  
                         $ ( i t e m s [ i ] ) . m o u s e o v e r ( f u n c t i o n ( )   {  
                                 m O v e r   =   t r u e ;  
                         } ) ;  
  
                         $ ( i t e m s [ i ] ) . m o u s e o u t ( f u n c t i o n ( )   {  
                                 m O v e r   =   f a l s e ;  
                                 f a d e E l e m e n t ( t r u e ) ;  
                         } ) ;  
  
                 } ) ;  
  
                 v a r   f a d e E l e m e n t   =   f u n c t i o n ( i s M o u s e O u t )   {  
                         v a r   t h i s T i m e O u t   =   ( i s M o u s e O u t )   ?   ( t i m e O u t   /   2 )   :   t i m e O u t ;  
                         t h i s T i m e O u t   =   ( f a d e r S t a t )   ?   1 0   :   t h i s T i m e O u t ;  
                         i f   ( i t e m s . l e n g t h   >   0 )   {  
                                 t i m e O u t F n   =   s e t T i m e o u t ( m a k e S l i d e r ,   t h i s T i m e O u t ) ;  
                         }   e l s e   {  
                                 c o n s o l e . l o g ( " P o o f . . " ) ;  
                         }  
                 }  
  
                 v a r   m a k e S l i d e r   =   f u n c t i o n ( )   {  
                         c u r r e n t   =   ( c u r r e n t   ! =   n u l l )   ?   c u r r e n t   :   i t e m s [ ( i t e m s . l e n g t h   -   1 ) ] ;  
                         v a r   c u r r N o   =   j Q u e r y . i n A r r a y ( c u r r e n t ,   i t e m s )   +   1  
                         c u r r N o   =   ( c u r r N o   = =   i t e m s . l e n g t h )   ?   0   :   ( c u r r N o   -   1 ) ;  
                         v a r   n e w M a r g i n   =   $ ( e l e m e n t ) . w i d t h ( )   *   c u r r N o ;  
                         i f   ( f a d e r S t a t   = =   t r u e )   {  
                                 i f   ( ! m O v e r )   {  
                                         $ ( i t e m s [ c u r r N o ] ) . f a d e I n ( ( t i m e O u t   /   6 ) ,   f u n c t i o n ( )   {  
                                                 i f   ( $ ( i t e m s S p a n [ c u r r N o ] ) . c s s ( ' b o t t o m ' )   = =   0 )   {  
                                                         $ ( i t e m s S p a n [ c u r r N o ] ) . s l i d e U p ( ( t i m e O u t   /   6 ) ,   f u n c t i o n ( )   {  
                                                                 f a d e r S t a t   =   f a l s e ;  
                                                                 c u r r e n t   =   i t e m s [ c u r r N o ] ;  
                                                                 i f   ( ! m O v e r )   {  
                                                                         f a d e E l e m e n t ( f a l s e ) ;  
                                                                 }  
                                                         } ) ;  
                                                 }   e l s e   {  
                                                         $ ( i t e m s S p a n [ c u r r N o ] ) . s l i d e D o w n ( ( t i m e O u t   /   6 ) ,   f u n c t i o n ( )   {  
                                                                 f a d e r S t a t   =   f a l s e ;  
                                                                 c u r r e n t   =   i t e m s [ c u r r N o ] ;  
                                                                 i f   ( ! m O v e r )   {  
                                                                         f a d e E l e m e n t ( f a l s e ) ;  
                                                                 }  
                                                         } ) ;  
                                                 }  
                                         } ) ;  
                                 }  
                         }   e l s e   {  
                                 i f   ( ! m O v e r )   {  
                                         i f   ( $ ( i t e m s S p a n [ c u r r N o ] ) . c s s ( ' b o t t o m ' )   = =   0 )   {  
                                                 $ ( i t e m s S p a n [ c u r r N o ] ) . s l i d e D o w n ( ( t i m e O u t   /   6 ) ,   f u n c t i o n ( )   {  
                                                         $ ( i t e m s [ c u r r N o ] ) . f a d e O u t ( ( t i m e O u t   /   6 ) ,   f u n c t i o n ( )   {  
                                                                 f a d e r S t a t   =   t r u e ;  
                                                                 c u r r e n t   =   i t e m s [ ( c u r r N o   +   1 ) ] ;  
                                                                 i f   ( ! m O v e r )   {  
                                                                         f a d e E l e m e n t ( f a l s e ) ;  
                                                                 }  
                                                         } ) ;  
                                                 } ) ;  
                                         }   e l s e   {  
                                                 $ ( i t e m s S p a n [ c u r r N o ] ) . s l i d e U p ( ( t i m e O u t   /   6 ) ,   f u n c t i o n ( )   {  
                                                         $ ( i t e m s [ c u r r N o ] ) . f a d e O u t ( ( t i m e O u t   /   6 ) ,   f u n c t i o n ( )   {  
                                                                 f a d e r S t a t   =   t r u e ;  
                                                                 c u r r e n t   =   i t e m s [ ( c u r r N o   +   1 ) ] ;  
                                                                 i f   ( ! m O v e r )   {  
                                                                         f a d e E l e m e n t ( f a l s e ) ;  
                                                                 }  
                                                         } ) ;  
                                                 } ) ;  
                                         }  
                                 }  
                         }  
                 }  
  
                 m a k e S l i d e r ( ) ;  
  
         } ;  
  
 } ) ( j Q u e r y ) ;     
