2014-12-13 18 views
0

我需要流暢的文本滾動條,像ticker,其中文本將逐個從一個接一個地平滑滾動到另一個,並且還需要懸停效果來停止動畫。我嘗試過使用jQuery,但沒有得到它。一個接一個地從左到右滾動列表標籤內容

 <ul id="ticker"> 
      <li>this is first title</li> 
      <li>this is second title</li> 
      <li>this is third title</li> 
      <li>this is fourth title</li> 
      <li>this is fifth title</li> 
     </ul> 

回答

0

你將不得不包裝你的UL和李元素選框,然後執行以下操作:

<marquee behavior="scroll" scrollamount="3" direction="left" 
    onmouseover="this.stop();" onmouseout="this.start();"> 
     <ul id="ticker"> 
      this is first title  
      this is second title 
      this is third title 
      this is fourth title 
      this is fifth title 
     </ul> 
</marquee> 

CSS

marquee { 
    text-indent:-100px; 
    width:450px; 
} 

Here是的jsfiddle

工作示例
+0

它不工作,它滾動所有列表標籤元素togather – monir009 2014-12-13 05:52:04

+0

@ monir009好所以什麼改變d你想讓我做? – 2014-12-13 05:53:56

+0

@ monir009你想要在一行中滾動? – 2014-12-13 05:54:21