ÿþ/ /   L e e   d i a l o g   1 . 0   h t t p : / / w w w . x i j . c n / b l o g / ? p = 6 8  
  
 v a r   d i a l o g F i r s t = t r u e ;  
 f u n c t i o n   d i a l o g ( t i t l e , c o n t e n t , w i d t h , h e i g h t , c s s N a m e ) {  
  
 i f ( d i a l o g F i r s t = = t r u e ) {  
     v a r   t e m p _ f l o a t = n e w   S t r i n g ;  
     t e m p _ f l o a t = " < d i v   i d = \ " f l o a t B o x B g \ "   s t y l e = \ " h e i g h t : " + $ ( d o c u m e n t ) . h e i g h t ( ) + " p x ; f i l t e r : a l p h a ( o p a c i t y = 0 ) ; o p a c i t y : 0 ; \ " > < / d i v > " ;  
     t e m p _ f l o a t + = " < d i v   i d = \ " f l o a t B o x \ "   c l a s s = \ " f l o a t B o x \ " > " ;  
     t e m p _ f l o a t + = " < d i v   c l a s s = \ " t i t l e \ " > < h 4 > < / h 4 > < s p a n > sQí•< / s p a n > < / d i v > " ;  
     t e m p _ f l o a t + = " < d i v   c l a s s = \ " c o n t e n t \ " > < / d i v > " ;  
     t e m p _ f l o a t + = " < / d i v > " ;  
     $ ( " b o d y " ) . a p p e n d ( t e m p _ f l o a t ) ;  
     d i a l o g F i r s t = f a l s e ;  
 }  
  
 $ ( " # f l o a t B o x   . t i t l e   s p a n " ) . c l i c k ( f u n c t i o n ( ) {  
     $ ( " # f l o a t B o x B g " ) . a n i m a t e ( { o p a c i t y : " 0 " } , " n o r m a l " , f u n c t i o n ( ) { $ ( t h i s ) . h i d e ( ) ; } ) ;  
     $ ( " # f l o a t B o x " ) . a n i m a t e ( { t o p : ( $ ( d o c u m e n t ) . s c r o l l T o p ( ) - ( h e i g h t = = " a u t o " ? 3 0 0 : p a r s e I n t ( h e i g h t ) ) ) + " p x " } , " n o r m a l " , f u n c t i o n ( ) { $ ( t h i s ) . h i d e ( ) ; } ) ;    
 } ) ;  
  
 $ ( " # f l o a t B o x   . t i t l e   h 4 " ) . h t m l ( t i t l e ) ;  
 c o n t e n t T y p e = c o n t e n t . s u b s t r i n g ( 0 , c o n t e n t . i n d e x O f ( " : " ) ) ;  
 c o n t e n t = c o n t e n t . s u b s t r i n g ( c o n t e n t . i n d e x O f ( " : " ) + 1 , c o n t e n t . l e n g t h ) ;  
 s w i t c h ( c o n t e n t T y p e ) {  
     c a s e   " u r l " :  
     v a r   c o n t e n t _ a r r a y = c o n t e n t . s p l i t ( " ? " ) ;  
     $ ( " # f l o a t B o x   . c o n t e n t " ) . a j a x S t a r t ( f u n c t i o n ( ) {  
         $ ( t h i s ) . h t m l ( " l o a d i n g . . . " ) ;  
     } ) ;  
     $ . a j a x ( {  
         t y p e : c o n t e n t _ a r r a y [ 0 ] ,  
         u r l : c o n t e n t _ a r r a y [ 1 ] ,  
         d a t a : c o n t e n t _ a r r a y [ 2 ] ,  
 	 e r r o r : f u n c t i o n ( ) {  
 	     $ ( " # f l o a t B o x   . c o n t e n t " ) . h t m l ( " e r r o r . . . " ) ;  
 	 } ,  
         s u c c e s s : f u n c t i o n ( h t m l ) {  
             $ ( " # f l o a t B o x   . c o n t e n t " ) . h t m l ( h t m l ) ;  
         }  
     } ) ;  
     b r e a k ;  
     c a s e   " t e x t " :  
     $ ( " # f l o a t B o x   . c o n t e n t " ) . h t m l ( c o n t e n t ) ;  
     b r e a k ;  
     c a s e   " i d " :  
     $ ( " # f l o a t B o x   . c o n t e n t " ) . h t m l ( $ ( " # " + c o n t e n t + " " ) . h t m l ( ) ) ;  
     b r e a k ;  
     c a s e   " i f r a m e " :  
     $ ( " # f l o a t B o x   . c o n t e n t " ) . h t m l ( " < i f r a m e   s r c = \ " " + c o n t e n t + " \ "   w i d t h = \ " 1 0 0 % \ "   h e i g h t = \ " " + ( p a r s e I n t ( h e i g h t ) - 3 0 ) + " p x " + " \ "   s c r o l l i n g = \ " a u t o \ "   f r a m e b o r d e r = \ " 0 \ "   m a r g i n h e i g h t = \ " 0 \ "   m a r g i n w i d t h = \ " 0 \ " > < / i f r a m e > " ) ;  
 }  
  
 $ ( " # f l o a t B o x B g " ) . s h o w ( ) ;  
 $ ( " # f l o a t B o x B g " ) . a n i m a t e ( { o p a c i t y : " 0 . 5 " } , " n o r m a l " ) ;  
 $ ( " # f l o a t B o x " ) . a t t r ( " c l a s s " , " f l o a t B o x   " + c s s N a m e ) ;  
 $ ( " # f l o a t B o x " ) . c s s ( { d i s p l a y : " b l o c k " , l e f t : ( ( $ ( d o c u m e n t ) . w i d t h ( ) ) / 2 - ( p a r s e I n t ( w i d t h ) / 2 ) ) + " p x " , t o p : ( $ ( d o c u m e n t ) . s c r o l l T o p ( ) - ( h e i g h t = = " a u t o " ? 3 0 0 : p a r s e I n t ( h e i g h t ) ) ) + " p x " , w i d t h : w i d t h , h e i g h t : h e i g h t } ) ;  
 $ ( " # f l o a t B o x " ) . a n i m a t e ( { t o p : ( $ ( d o c u m e n t ) . s c r o l l T o p ( ) + 5 0 ) + " p x " } , " n o r m a l " ) ;    
 } 
