2013-11-20 68 views
0

我在我的網站上使用jquery li scroll plugin來創建新聞動態,這個jqueryli滾動插件需要你的新聞在<li>標籤,這個插件對我來說工作正常,但問題是我想在新聞發佈之前放置文本。如何使ul之前的文本進入html單行?

我要像NEWS FEED : actual news

目前我已經實現了「實際的新聞」,當我試圖把NEWS FEED標籤在股票的弗朗它給我的問題的輸出。

的問題是,當我把NEWS FEED標籤的股票前,該股票新聞轉到下一行,我走出瞭如:

NEWS FEED : 

             "actual news " 

我用代碼:

<div>NEWS FEED 
    <ul id="ticker01"> 
    <?php foreach ($news_array as $single_news) : ?> 
    <li><span><?php echo $single_news; ?><span></li> 
    <?php endforeach; ?> 
    </ul> 
<div> 

我如何在單行中實現NEWS FEED標籤和新聞動態?

我已經編輯CSS如下:

.tickercontainer { /* the outer div with the black border */ 


width: 850px; 
height: 32px; 
margin-left: 100px; 
padding: 0; 
overflow: hidden; 
} 
.tickercontainer .mask { /* that serves as a mask. so you get a sort of padding both left and right */ 
position: relative; 
left: 10px; 
top: 8px; 
width: 718px; 
} 
ul.newsticker { /* that's your list */ 
position: relative; 
left: 750px; 
font: bold 10px Verdana; 
list-style-type: none; 
margin: 0; 
padding: 0; 

} 
ul.newsticker li { 
float: left; /* important: display inline gives incorrect results when you check for elem's width */ 
margin: 0; 
padding: 0; 
background: #fff; 
} 
ul.newsticker a { 
white-space: nowrap; 
padding: 0; 
color: #ff0000; 
font: bold 10px Verdana; 
margin: 0 50px 0 0; 
} 
ul.newsticker span { 
white-space: nowrap; 
padding: 0; 
font-family: "Times New Roman"; 
font-size: 16px; 
color: #ff0000; 
margin: 0 50px 0 0; 
} 



/* liScroll styles */ 

這裏是問題小提琴click here

+0

你可以嘗試加入 '新聞提要' 內部''並添加'浮動:left'兩害麼? – putvande

+0

顯示你的CSS。 'jquery li scroll plugin'應該已經爲你提供了這個功能。你正在實施它是錯誤的。 – Ani

+0

我不希望NEWS FEED正在移動文本,而是我希望它修復。 – Akki

回答

2

好吧完成。

作品:http://jsfiddle.net/p6akP/2/

#outerdiv{ 
    float:left; 
    width:1000px; 
} 

.tickercontainer { /* the outer div with the black border */ 
    width: 850px; 
    height: 32px; 
    float:right; 
    padding: 0; 
     overflow: hidden; 
} 

.tickercontainer .mask { 
    top:0; 
    //other styling you have 
    } 

<div id="outerdiv">NEWS FEED 
    <ul id="ticker01"> 
    <li><span>10/10/2007</span><a href="#">The first thing ...</a></li> 
    <li><span>10/10/2007</span><a href="#">End up doing is ...</a></li> 
    <li><span>10/10/2007</span><a href="#">The code that you ...</a></li> 
    </ul> 
<div> 
+0

哈哈..是的,當然..我補充說,JS打電話 – Akki

+0

你可以創建小提琴鏈接和複製問題? – Ani

+0

讓我試試..這是一個不錯的選擇 – Akki

相關問題