By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,741 Members | 1,973 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,741 IT Pros & Developers. It's quick & easy.

Help with a marquee.

P: 12
Hi I made this marquee program however, I am having trouble getting all four marquees to line up correctly. Basically I want the the 4 marquees to line up on the four sides exactly so they intersect. Three of them look good. With fourth the marquee does something funny this is illustrated if you change the border color of the "up" marquee in the program. Help and insights would be appreciated.
Here is the program, it is computationally expensive so it may take a few seconds to load.

Te code:


Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. //1. Draws the down marquee
  4. <marquee direction = "down" width = 45 height = 700 vspace="2" hspace="2" style="position:absolute; right: 2px; background: green; font-family:arial">
  5.  
  6.  
  7. <script type="text/javascript">
  8.  
  9. for (i = 39500; i <= 40000; i++)
  10. {
  11. document.write(String.fromCharCode(i).fontcolor("Blue").fontsize(16) );
  12. document.write("<br />");
  13.  
  14. }
  15. </script>
  16.  
  17.  
  18.  
  19.  
  20. </marquee>
  21.  
  22.  
  23. //2. Draws the right marquee
  24. <marquee direction = "right" width = 900 style="position:relative; left: 60px; background: green; font-family:arial">
  25.  
  26.  
  27. <script type="text/javascript">
  28.  
  29. for (i = 39500; i <= 40000; i++)
  30. {
  31. document.write(String.fromCharCode(i).fontcolor("Blue").fontsize(16) );
  32.  
  33. }
  34. </script> 
  35. </marquee>
  36.  
  37.  
  38.  
  39.  
  40. //3. Draws the up marquee the one giving me problems its border usurps the //window. Change color for illustartion
  41. <marquee direction="up" " " vspace="5" hspace="5" border-width: 3px align="left" width="45" height="500" style="font-size:12px;color:#000000;font-family:verdana;">
  42.  
  43. <script type="text/javascript">
  44.  
  45. for (i = 39500; i <= 40000; i++)
  46. {
  47. document.write(String.fromCharCode(i).fontcolor("Blue").fontsize(16) );
  48. document.write("<br />");
  49. }
  50. </script>
  51. </marquee>
  52.  
  53.  
  54.  
  55.  
  56.  
  57. <marquee direction = "left" width = 900 height = 45  align = "right" scrollamount = 5 background: green;
  58.   style= "background: red; border = 0; font-family:arial">
  59.  
  60.  
  61. <script type="text/javascript">
  62.  
  63. for (i = 39500; i <= 40000; i++)
  64. {
  65. document.write(String.fromCharCode(i).fontcolor("Blue").fontsize(16) );
  66.  
  67. }
  68. </script>
  69. </marquee>
  70.  
  71. <p align=center>Explanation:</p>
  72.  
  73. <p align=center>This is a marquee character loop starts with i=0.</p>
  74.  
  75.  
  76.  
  77.  
  78.  
  79. </body>
  80. </html>
Nov 2 '08 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
The marquee tag is non-standard and not recommended.

However, I notice some extra quotes on line 41 which might cause some problems.
Nov 3 '08 #2

P: 12
Thanks much. I notice you help a lot of people here.

I will try removing the quotes.

Is there a more standard way of doing a marquee in javascript?
Nov 4 '08 #3

acoder
Expert Mod 15k+
P: 16,027
Not by using the marquee tag. You can, however, create a marquee effect using JavaScript only (style.left/style.top and setInterval, etc.)
Nov 4 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.