View Full Version : Cross Browser Marquee Problem

05-01-2010, 06:12 PM
1) Script Title: Cross Browser Marquee

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/cmarquee.htm

3) Describe problem: How do I center this scroller in my table? No matter what ai do it's always on the left.
Thanks, Jim

05-02-2010, 04:21 PM
Impossible to say without seeing the page. In most cases adding the highlighted inside the script should do it:

document.write('<table style="width:'+marqueewidth+'" align="center" border="0" cellspacing="0" cellpadding="0"><td>')

The line you are looking for unedited looks like so:

document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')

If you want more help:

Please post a link to a page on your site that contains the problematic code so we can check it out.

05-03-2010, 08:30 PM
Here's another problem.
Why does the scroller appear twice the heigth I epecified? I specified a heigth of 29px and you can see what I got. Also do you know why my site expands on opening then closes to the correct size of 850px. It started happening when I started adding scripts from DD.
Thanks again, Jim

05-04-2010, 01:45 PM
The marquee is 29px high. Add this to your stylesheet temporarily and you will see that:

#iemarquee {
background-color: red;

The things that are taller are the containing and other td tag in that row. I see you have them set to 29px height also, but something is forcing them to be taller. I think it is this, in your source code, at the end of the marquee script:


Coming after the script generated table, that would force a line break, adding 1em (this varies depending upon the prevailing font size at that spot in your markup) of height to the cell. That could easily account for what you are observing. Try getting rid of it.

About the page jumping around, I'm not 100% sure why that's happening but I have an idea it may be the crawler. If so, you should be able to surround the crawler division (the one with the id of mycrawler2) with another, set this other division's width to that of the crawler, set its overflow to hidden.

This jumping about (from crawler) only happens in IE with a crawler in a table. In IE 8, if you have a valid URL DOCTYPE, it won't happen. That's what makes me think it's the crawler, because the page is fine in other browsers, and fine in IE 8 when I set the mode to strict.

05-04-2010, 08:19 PM
Thanks, I'' give your suggestio a try.