js设置容器的滚动条 js实现滚动条效果_滚动条

< 
  script  
  type 
  ="text/javascript"  
  src  
  ="js/jquery.min.js"></  
  script 
  >
 
 
< 
   script  
   type 
   ="text/javascript"  
   src  
   ="js/sdmenu.js"></  
   script 
   >
 
  
< 
   script  
   type 
   ="text/javascript">
 
  
    window.onload =  
   function 
   () {
 
  
         
   var  
   myMenu;
 
  
        myMenu =  
   new  
   SDMenu( 
   "my_menu"  
   );
 
  
        myMenu.init();
 
  
         
   var  
   SDmodel =  
   new  
   scrollDoor();
 
  
    };   
 
  
</ 
   script 
   >
 
 

 
 

 
 
       
  < 
  div  
  class 
  ="rollnews">
 
 
             
  < 
  ul  
  style 
  =" 
  float  
  :  
  left 
  ;  
  width 
  :  
  90px  
  ;  
  color 
  :  
  #305fb6 
  ; 
  ">
 
 
                 
  < 
  strong 
  >  
  公告: 
  </ 
  strong  
  ></ 
  ul 
  >
 
 
             
  < 
  ul  
  id 
  ="demo">
 
 
                 
  < 
  table  
  border 
  ="0"  
  cellpadding 
  ="1"  
  cellspacing 
  ="1"  
  cellspace 
  ="0">
 
 
                     
  < 
  tr 
  >
 
 
                         
  < 
  td  
  id 
  ="marquePic1">
 
 
                             
  < 
  table  
  width 
  ='880'  
  border 
  ='0'  
  cellspacing 
  ='0'>
 
 
                                 
  < 
  tr 
  >
 
 
                                    <%
 
 
                                        BizComponents. 
  Notice_Biz  
  biz =  
  new  
  BizComponents. 
  Notice_Biz  
  ();
 
 
                                        System.Collections.Generic. 
  List  
  <Entity. 
  Notice 
  > list = biz.Notice_GetAll( 
  "*"  
  );
 
 
                                         
  if  
  (list.Count > 0)
 
 
                                        {
 
 
                                             
  for  
  ( 
  int  
  i = 0; i < list.Count; i++)
 
 
                                            {
 
 
              
 
 
                                    %>
 
 
                                     
  < 
  td 
  >
 
 
                                         
  < 
  a  
  href 
  =' 
  <% =list[i].Link %> 
  '  
  target 
  ="_blank">
 
 
                                            <% 
  = 
  list[i].AddTime.ToString(  
  "yyyy-MM-dd" 
  ) %> 
  :
 
 
                                            <% 
  = 
  getStr(list[i].Title,35) %> 
  </ 
  a  
  >
 
 
                                     
  </ 
  td 
  >
 
 
                                    <%}
 
 
                                        }
 
 
                                         
  else
 
 
                                        { %>
 
 
                                     
  < 
  td 
  >
 
 
                                         
  < 
  span  
  style 
  =" 
  color  
  :  
  Red 
  ;  
  font-size 
  :  
  12px  
  ; 
  "> 
  暂无数据  
  ... 
  </ 
  span  
  >
 
 
                                     
  </ 
  td 
  >
 
 
                                    <%
 
 
                                        } %>
 
 
                                 
  </ 
  tr 
  >
 
 
                             
  </ 
  table 
  >
 
 
                         
  </ 
  td 
  >
 
 
                         
  < 
  td  
  id 
  ="marquePic2"  
  valign 
  ="top">
 
 
                         
  </ 
  td 
  >
 
 
                     
  </ 
  tr 
  >
 
 
                 
  </ 
  table 
  >
 
 
             
  </ 
  ul 
  >
 
 
             
  < 
  p  
  class 
  ="clear">
 
 
             
  </ 
  p 
  >
 
 
         
  </ 
  div 
  >
 
 

 
 
         
  < 
  script  
  type 
  ="text/javascript">
 
 
var  
  speed=50
 
 
marquePic2.innerHTML=marquePic1.innerHTML
 
 
function  
  Marquee(){
 
 
if 
  (demo.scrollLeft>=marquePic1.scrollWidth){
 
 
demo.scrollLeft=0
 
 
} 
  else 
  {
 
 
demo.scrollLeft++
 
 
}
 
 
}
 
 
var  
  MyMar=setInterval(Marquee,speed)
 
 
demo.οnmοuseοver=  
  function 
  () {clearInterval(MyMar)}
 
 
demo.οnmοuseοut=  
  function 
  () {MyMar=setInterval(Marquee,speed)}
 
 
         
  </ 
  script 
  >