ÿþ/ *  
  
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 A c c e s s i b l e   N e w s   S l i d e r  
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	  
 A u t h o r :  
 B r i a n   R e i n d e l  
 	  
 A u t h o r   U R L :  
 h t t p : / / b l o g . r e i n d e l . c o m  
  
 L i c e n s e :  
 U n r e s t r i c t e d .   T h i s   s c r i p t   i s   f r e e   f o r   b o t h   p e r s o n a l   a n d   c o m m e r c i a l   u s e .  
  
 * /  
  
 j Q u e r y . f n . a c c e s s N e w s   =   f u n c t i o n ( s e t t i n g s )  
 {  
         s e t t i n g s   =   j Q u e r y . e x t e n d ( {  
                 h e a d l i n e :   " T o p   S t o r i e s " ,  
                 s p e e d :   " n o r m a l " ,  
                 s l i d e B y :   2  
         } ,   s e t t i n g s ) ;  
         r e t u r n   t h i s . e a c h ( f u n c t i o n ( )  
         {  
                 j Q u e r y . f n . a c c e s s N e w s . r u n ( j Q u e r y ( t h i s ) ,   s e t t i n g s ) ;  
         } ) ;  
 } ;  
 j Q u e r y . f n . a c c e s s N e w s . r u n   =   f u n c t i o n ( $ t h i s ,   s e t t i n g s )  
 {  
         j Q u e r y ( " . j a v a s c r i p t _ c s s " ,   $ t h i s ) . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
         v a r   u l   =   j Q u e r y ( " u l : e q ( 0 ) " ,   $ t h i s ) ;  
         v a r   l i   =   u l . c h i l d r e n ( ) ;  
         i f   ( l i . l e n g t h   >   s e t t i n g s . s l i d e B y )  
         {  
                 v a r   $ n e x t   =   j Q u e r y ( " . n e x t   >   a " ,   $ t h i s ) ;  
                 v a r   $ b a c k   =   j Q u e r y ( " . b a c k   >   a " ,   $ t h i s ) ;  
                 v a r   l i W i d t h   =   j Q u e r y ( l i [ 0 ] ) . w i d t h ( ) ;  
                 v a r   a n i m a t i n g   =   f a l s e ;  
                 u l . c s s ( " w i d t h " ,   ( l i . l e n g t h   *   l i W i d t h ) ) ;  
                 $ n e x t . c l i c k ( f u n c t i o n ( )  
                 {  
                         i f   ( ! a n i m a t i n g )  
                         {  
                                 a n i m a t i n g   =   t r u e ;  
                                 o f f s e t L e f t   =   p a r s e I n t ( u l . c s s ( " l e f t " ) )   -   ( l i W i d t h   *   s e t t i n g s . s l i d e B y ) ;  
                                 i f   ( o f f s e t L e f t   +   u l . w i d t h ( )   >   0 )  
                                 {  
                                         $ b a c k . c s s ( " d i s p l a y " ,   " b l o c k " ) ;  
                                         u l . a n i m a t e ( {  
                                                 l e f t :   o f f s e t L e f t  
                                         } ,   s e t t i n g s . s p e e d ,   f u n c t i o n ( )  
                                         {  
                                                 i f   ( p a r s e I n t ( u l . c s s ( " l e f t " ) )   +   u l . w i d t h ( )   < =   l i W i d t h   *   s e t t i n g s . s l i d e B y )  
                                                 {  
                                                         $ n e x t . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
                                                 }  
                                                 a n i m a t i n g   =   f a l s e ;  
                                         } ) ;  
                                 }   e l s e  
                                 {  
                                         a n i m a t i n g   =   f a l s e ;  
                                 }  
                         }  
                         r e t u r n   f a l s e ;  
                 } ) ;  
                 $ b a c k . c l i c k ( f u n c t i o n ( )  
                 {  
                         i f   ( ! a n i m a t i n g )  
                         {  
                                 a n i m a t i n g   =   t r u e ;  
                                 o f f s e t R i g h t   =   p a r s e I n t ( u l . c s s ( " l e f t " ) )   +   ( l i W i d t h   *   s e t t i n g s . s l i d e B y ) ;  
                                 i f   ( o f f s e t R i g h t   +   u l . w i d t h ( )   < =   u l . w i d t h ( ) )  
                                 {  
                                         $ n e x t . c s s ( " d i s p l a y " ,   " b l o c k " ) ;  
                                         u l . a n i m a t e ( {  
                                                 l e f t :   o f f s e t R i g h t  
                                         } ,   s e t t i n g s . s p e e d ,   f u n c t i o n ( )  
                                         {  
                                                 i f   ( p a r s e I n t ( u l . c s s ( " l e f t " ) )   = =   0 )  
                                                 {  
                                                         $ b a c k . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
                                                 }  
                                                 a n i m a t i n g   =   f a l s e ;  
                                         } ) ;  
                                 }   e l s e  
                                 {  
                                         a n i m a t i n g   =   f a l s e ;  
                                 }  
                         }  
                         r e t u r n   f a l s e ;  
                 } ) ;  
                 $ n e x t . c s s ( " d i s p l a y " ,   " b l o c k " )  
 	 	 	 	 	 / / . p a r e n t ( ) . a f t e r ( [ " < p   c l a s s = \ " v i e w _ a l l \ " > " ,   s e t t i n g s . h e a d l i n e ,   "     (   < a   h r e f = \ " # \ " > < / a >   ) < / p > " ] . j o i n ( " " ) ) ;  
 	 	 	 	 	 / / . p a r e n t ( ) . a f t e r ( [ " < p   c l a s s = \ " v i e w _ a l l \ " > " ,   s e t t i n g s . h e a d l i n e ,   "     (   < a   h r e f = \ " # \ " > FE'Ì4  *E'EÌ  '.('1< / a >   ) < / p > " ] . j o i n ( " " ) ) ;  
                 / / . p a r e n t ( ) . a f t e r (   [   " < p   c l a s s = \ " v i e w _ a l l \ " > " ,   s e t t i n g s . h e a d l i n e ,   "   -   " ,   l i . l e n g t h ,   "   t o t a l   (   < a   h r e f = \ " # \ " > *E'EÌ  .(1  G'< / a >   ) < / p > "   ] . j o i n (   " "   )   ) ;  
  
                 j Q u e r y ( " . v i e w _ a l l   >   a ,   . s k i p _ t o _ n e w s   >   a " ,   $ t h i s ) . c l i c k ( f u n c t i o n ( )  
                 {  
                         v a r   s k i p _ t o _ n e w s   =   ( j Q u e r y ( t h i s ) . h t m l ( )   = =   " S k i p   t o   N e w s " ) ;  
                         i f   ( j Q u e r y ( t h i s ) . h t m l ( )   = =   " FE'Ì4  *E'EÌ  '.('1"   | |   s k i p _ t o _ n e w s )  
                         {  
                                 u l . c s s ( " w i d t h " ,   " a u t o " ) . c s s ( " l e f t " ,   " 0 " ) ;  
                                 $ n e x t . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
                                 $ b a c k . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
                                 i f   ( ! s k i p _ t o _ n e w s )  
                                 {  
                                         j Q u e r y ( t h i s ) . h t m l ( " ('2¯4*" ) ;  
                                 }  
                         }   e l s e  
                         {  
                                 i f   ( ! s k i p _ t o _ n e w s )  
                                 {  
                                         j Q u e r y ( t h i s ) . h t m l ( " FE'Ì4  *E'EÌ  '.('1" ) ;  
                                 }  
                                 u l . c s s ( " w i d t h " ,   ( l i . l e n g t h   *   l i W i d t h ) ) ;  
                                 $ n e x t . c s s ( " d i s p l a y " ,   " b l o c k " ) ;  
                         }  
                         r e t u r n   f a l s e ;  
                 } ) ;  
         }  
 } ; 
