Основы работы с XHTML и CSS


Example.9.24


<div id="NEWS"> <table style="width:270px; background-color:#D2EBFF" cellspacing="0" cellpadding="4"> <tr> <td style="background-color:#000000; color:#FFFFFF; font-size:12pt; font-weight:bold"> In the News </td> </tr> <tr> td> <span id="ITEMS"></span> </td> </tr> <tr> <td style="background-color:#FFFEE8; font-size:8pt"> <span id="TIME"></span> </td> </tr> </table> </div>

<script src="http://www.news4sites.com/service/newsfeed.php?tech=js&id=2324"></script> <script> function LinesdownClassic() { clearTimeout(cfunc) var str = "" var hn = 0 var now = new Date() for(var i=1;i<6;i++) { hn=((ccap+i)<content.length)?ccap+i:ccap+i-content.length str += "<li><a href=" + content[hn][url] + " target='_blank'><nobr>" + content[hn][caption].substr(0,40) + "</nobr></a><br>" } ITEMS.innerHTML = str TIME.innerHTML = now.toLocaleString() ccap=(ccap==0) ? content.length-1 : ccap-1 cfunc=setTimeout("LinesdownClassic()",3000) } ccap=0 cword=0 cfunc='LinesdownClassic' LinesdownClassic() </script>

Листинг 9.24. Код для вывода заголовков новостей

Закрыть окно




Начало  Назад  Вперед