 <
				head
				>
				<
				head
				>
				
						
						 <
				meta 
				http-equiv
				="Content-Type"
				 content
				="text/html; charset=utf-8"
				 
				/>
				
				<
				meta 
				http-equiv
				="Content-Type"
				 content
				="text/html; charset=utf-8"
				 
				/>
				
						
						 <
				title
				>
				Untitled Document
				</
				title
				>
				
				<
				title
				>
				Untitled Document
				</
				title
				>
				
						
						 
						 <
				script 
				language
				="javascript"
				 type
				="text/javascript"
				>
				
				<
				script 
				language
				="javascript"
				 type
				="text/javascript"
				>
				
						 
				
				
						
								
								 <!--
						
						<!--
						
								
								 
								 /**/
						
								/*
								******************************
								*/
						
						/**/
						
								/*
								******************************
								*/
						
						
								
								 
								 /**/
						
								/*
								        文字自动循环滚动        
								*/
						
						/**/
						
								/*
								        文字自动循环滚动        
								*/
						
						
								
								 
								 /**/
						
								/*
								        Power by Todd Lee        
								*/
						
						/**/
						
								/*
								        Power by Todd Lee        
								*/
						
						
								
								 
								 /**/
						
								/*
								        lijiantao@eyou.com        
								*/
						
						/**/
						
								/*
								        lijiantao@eyou.com        
								*/
						
						
								
								 
								 /**/
						
								/*
								        www.todd-lee.com        
								*/
						
						/**/
						
								/*
								        www.todd-lee.com        
								*/
						
						
								
								 
								 /**/
						
								/*
								        IE6 FF1.0.4                
								*/
						
						/**/
						
								/*
								        IE6 FF1.0.4                
								*/
						
						
								
								 
								 /**/
						
								/*
								        不支持xhtml声明的文档    
								*/
						
						/**/
						
								/*
								        不支持xhtml声明的文档    
								*/
						
						
								
								 
								 /**/
						
								/*
								        2005-05-24 v1.0            
								*/
						
						/**/
						
								/*
								        2005-05-24 v1.0            
								*/
						
						
								
								 
								 /**/
						
								/*
								******************************
								*/
						
						/**/
						
								/*
								******************************
								*/
						
						
								
								 
								
								 //
						*********不要修改这部分***************
						
						//
						*********不要修改这部分***************
						
								
								 //
						scrollBodyId:    String 内部滚动div的id
//
						scrollBodyId:    String 内部滚动div的id
						
								
								 //
						scrollBoxId:    String 外面限制div的id
//
						scrollBoxId:    String 外面限制div的id
						
								
								 //
						showHeight:    Int 限制显示高度
//
						showHeight:    Int 限制显示高度
						
								
								 //
						showWidth:    Int 限制显示宽度
//
						showWidth:    Int 限制显示宽度
						
								
								 //
						lineHeight:    Int 每行的高度
//
						lineHeight:    Int 每行的高度
						
								
								 //
						stopTime:        Int 间隔停止的时间(毫秒)
//
						stopTime:        Int 间隔停止的时间(毫秒)
						
								
								 //
						speed:        Int 滚动速度(毫秒,越小越快)
//
						speed:        Int 滚动速度(毫秒,越小越快)
						
								
								 
								 var
						 ScrollObj 
						=
						 
						function
						(scrollBodyId,scrollBoxId,showHeight,showWidth,lineHeight,stopTime,speed)
						
						var
						 ScrollObj 
						=
						 
						function
						(scrollBodyId,scrollBoxId,showHeight,showWidth,lineHeight,stopTime,speed) 
						
								 {
						
						
								{
 this
								.obj 
								=
								 document.getElementById(scrollBodyId);
    
								this
								.obj 
								=
								 document.getElementById(scrollBodyId);
 this
								.box 
								=
								 document.getElementById(scrollBoxId);
    
								this
								.box 
								=
								 document.getElementById(scrollBoxId);
 
    
 this
								.style 
								=
								 
								this
								.obj.style;
    
								this
								.style 
								=
								 
								this
								.obj.style;
 this
								.defaultHeight 
								=
								 
								this
								.obj.offsetHeight;
    
								this
								.defaultHeight 
								=
								 
								this
								.obj.offsetHeight;
 
    
 this
								.obj.innerHTML 
								+=
								 
								this
								.obj.innerHTML;
    
								this
								.obj.innerHTML 
								+=
								 
								this
								.obj.innerHTML;
 this
								.obj.style.position 
								=
								 
								"
								relative
								"
								;
    
								this
								.obj.style.position 
								=
								 
								"
								relative
								"
								;
 
    
 this
								.box.style.height 
								=
								 showHeight;
    
								this
								.box.style.height 
								=
								 showHeight;
 this
								.box.style.width 
								=
								 showWidth;
    
								this
								.box.style.width 
								=
								 showWidth;
 this
								.box.style.overflow 
								=
								 
								"
								hidden
								"
								;
    
								this
								.box.style.overflow 
								=
								 
								"
								hidden
								"
								;
 
    
 this
								.scrollUp 
								=
								 doScrollUp;
    
								this
								.scrollUp 
								=
								 doScrollUp;

 this
								.stopScroll 
								=
								 
								false
								;
    
								this
								.stopScroll 
								=
								 
								false
								;
 
    
 this
								.curLineHeight 
								=
								 
								0
								;
    
								this
								.curLineHeight 
								=
								 
								0
								;
 this
								.lineHeight 
								=
								 lineHeight;
    
								this
								.lineHeight 
								=
								 lineHeight;
 this
								.curStopTime 
								=
								 
								0
								;
    
								this
								.curStopTime 
								=
								 
								0
								;
 this
								.stopTime 
								=
								 stopTime;
    
								this
								.stopTime 
								=
								 stopTime;
 this
								.speed 
								=
								 speed;
    
								this
								.speed 
								=
								 speed;

 this
								.style.top 
								=
								 lineHeight;
    
								this
								.style.top 
								=
								 lineHeight;

 this
								.object 
								=
								 scrollBodyId 
								+
								 
								"
								Object
								"
								;
    
								this
								.object 
								=
								 scrollBodyId 
								+
								 
								"
								Object
								"
								;
 eval(
								this
								.object 
								+
								 
								"
								=this
								"
								);
    eval(
								this
								.object 
								+
								 
								"
								=this
								"
								);
 setInterval(
								this
								.object
								+
								"
								.scrollUp()
								"
								,speed);
    setInterval(
								this
								.object
								+
								"
								.scrollUp()
								"
								,speed);
 this
								.obj.onmouseover
								=
								new
								 Function(
								this
								.object
								+
								"
								.stopScroll=true
								"
								);
    
								this
								.obj.onmouseover
								=
								new
								 Function(
								this
								.object
								+
								"
								.stopScroll=true
								"
								);
 this
								.obj.onmouseout
								=
								new
								 Function(
								this
								.object
								+
								"
								.stopScroll=false
								"
								);
    
								this
								.obj.onmouseout
								=
								new
								 Function(
								this
								.object
								+
								"
								.stopScroll=false
								"
								);
 }
}
						
						
								
								 
								 function
						 doScrollUp()
						
						function
						 doScrollUp()
						
								 {
						
						
								{
 if
								( 
								this
								.stopScroll 
								==
								 
								true
								 )
    
								if
								( 
								this
								.stopScroll 
								==
								 
								true
								 )
 return
								;
        
								return
								;
 this
								.curLineHeight 
								+=
								 
								1
								;
      
								this
								.curLineHeight 
								+=
								 
								1
								;

 if
								( 
								this
								.curLineHeight 
								>=
								 
								this
								.lineHeight )
      
								if
								( 
								this
								.curLineHeight 
								>=
								 
								this
								.lineHeight )
								
										 {
								
								
										{
 this
										.curStopTime 
										+=
										 
										1
										;
          
										this
										.curStopTime 
										+=
										 
										1
										;

 if
										( 
										this
										.curStopTime 
										>=
										 
										this
										.stopTime )
          
										if
										( 
										this
										.curStopTime 
										>=
										 
										this
										.stopTime )
										
												 {
										
										
												{
 this
												.curLineHeight 
												=
												 
												0
												;
              
												this
												.curLineHeight 
												=
												 
												0
												;
 this
												.curStopTime 
												=
												 
												0
												;
              
												this
												.curStopTime 
												=
												 
												0
												;
 }
          }
										
										
												
												 }
      }
								
								
										
										 
										 else
    
								else
								
										 {
								
								
										{      
 this
										.style.top 
										=
										 parseInt(
										this
										.style.top) 
										-
										 
										1
										;
          
										this
										.style.top 
										=
										 parseInt(
										this
										.style.top) 
										-
										 
										1
										;

 if
										( 
										-
										parseInt(
										this
										.style.top) 
										>=
										 
										this
										.defaultHeight )
          
										if
										( 
										-
										parseInt(
										this
										.style.top) 
										>=
										 
										this
										.defaultHeight )
										
												 {
										
										
												{
 this
												.style.top 
												=
												 
												0
												;
            
												this
												.style.top 
												=
												 
												0
												;
 }
          }
										
										
												
												 }
      }
								
								
										
										 }
}
						
						
								
								 //
						***************这以上不要修改******************
						
						//
						***************这以上不要修改******************
						
								
								 //
						-->
//
						-->
						
								
								 </
				script
				>
						
				
				</
				script
				>
				
						
						 </
				head
				>
				
				</
				head
				>
				
						
						 
						
						 <
				body
				>
				
				<
				body
				>
				
						
						 <
				div 
				id
				="scroollBox"
				 style
				="border:1px solid red; "
				>
				
				<
				div 
				id
				="scroollBox"
				 style
				="border:1px solid red; "
				>
				
						
						 <
				div 
				id
				="scroollBody"
				>
				
				<
				div 
				id
				="scroollBody"
				>
				
						
						 这里是一些提示信息
				<
				br
				>
    这里是一些提示信息
				<
				br
				>
				
						
						 他可以自动向上循环的滚动
				<
				br
				>
    他可以自动向上循环的滚动
				<
				br
				>
				
						
						 每滚动一行,就会停下来休息一会
				<
				br
				>
    每滚动一行,就会停下来休息一会
				<
				br
				>
				
						
						 当鼠标经过他的时候,他停止滚动
				<
				br
				>
    当鼠标经过他的时候,他停止滚动
				<
				br
				>
				
						
						 当鼠标离开时,他继续滚动
				<
				br
				>
    当鼠标离开时,他继续滚动
				<
				br
				>
				
						
						 </
				div
				>
				
				</
				div
				>
				
						
						 </
				div
				>
				
				</
				div
				>
				
						
						 
						 <
				script 
				language
				="javascript"
				 type
				="text/javascript"
				>
				
				<
				script 
				language
				="javascript"
				 type
				="text/javascript"
				>
				
						 
				
				
						
								
								 <!--
						
						<!--
						 
 var
						 sample 
						=
						 
						new
						 ScrollObj(
						"
						scroollBody
						"
						,
						"
						scroollBox
						"
						,
						25
						,
						300
						,
						19
						,
						63
						,
						50
						);
						var
						 sample 
						=
						 
						new
						 ScrollObj(
						"
						scroollBody
						"
						,
						"
						scroollBox
						"
						,
						25
						,
						300
						,
						19
						,
						63
						,
						50
						);
 //
						 -->
						//
						 -->
						
								
								 </
				script
				>
						
				
				</
				script
				>
				
						
						 </
				body
				>
				
				</
				body
				>
				
						
						 </
				html
				>
				
				</
				html
				>
		 
	posted on 2006-10-18 11:03 
Alpha 阅读(6479) 
评论(0)  编辑  收藏  所属分类: 
JavaScript