home *** CD-ROM | disk | FTP | other *** search
/ PC User 2005 May / CD / PCU0505CD.iso / software / full / coffecup / files / html2005.exe / %MAINDIR% / Javascript / alertscroll.xml < prev    next >
Encoding:
Text File  |  2005-02-16  |  1.9 KB  |  60 lines

  1. <ccResource>
  2.   <ccTitle>
  3. Alert Scrollbar
  4.   </ccTitle>
  5.   <ccCategory>
  6. Browser
  7.   </ccCategory>
  8.   <ccDescription>
  9. This unique scroller scrolls text at the very top of the page, making it hard to ignore.
  10.   </ccDescription>
  11.   <ccInstructions>
  12. The code goes only inside the BODY tags.  You can change the items below to suit your needs.
  13.   </ccInstructions>
  14.   <ccHeadContent>
  15.   
  16.   </ccHeadContent>
  17.   <ccBodyContent>
  18. <marquee id="alertit" style="position:absolute;left:0px;top:0;background-color:#FFFFE6" onMouseover="this.scrollAmount=1" onMouseout="this.scrollAmount=speed"></marquee>
  19.  
  20. <script type="text/javascript">
  21.  
  22. //Customize your message here. Use any HTML desired:
  23. var themsg='<span style="font:italic 22px Arial;color:red;"><b>Breaking News: Microsoft Stock up 10 points! Source: <a href="http://cnn.com" target="_new">CNN</a></b></span>'
  24. var speed=6 //speed of scroller (1-10 or more)
  25. var loops=2 //specify number of times message scrolls across screen (an integer or "infinite")
  26.  
  27. function populatescroller(){
  28. var windowwidth=iecompattest().clientWidth
  29. document.getElementById("alertit").innerHTML=themsg
  30. document.getElementById("alertit").style.width=windowwidth
  31. document.getElementById("alertit").scrollAmount=speed
  32. document.getElementById("alertit").scrollDelay=20
  33. document.getElementById("alertit").loop=loops
  34. document.getElementById("alertit").onfinish=function(){
  35. document.getElementById("alertit").style.visibility="hidden"
  36. }
  37. }
  38.  
  39. function iecompattest(){
  40. return (document.compatMode!="BackCompat")? document.documentElement : document.body
  41. }
  42.  
  43. if (document.all && document.getElementById){
  44. window.onload=populatescroller
  45. window.onresize=populatescroller
  46. }
  47.  
  48. </script>
  49.   </ccBodyContent>
  50.   <ccElementContent>
  51.   
  52.    <ccElementName></ccElementName>
  53.    <ccElementAction></ccElementAction>
  54.    
  55.   </ccElementContent>
  56.   <ccExtraData>
  57.  
  58.   </ccExtraData>
  59. </ccResource>
  60.