View Full Version : Mike's DHTML scroller and Firefox 1.06

08-23-2005, 09:26 PM
I am having a problem with Mike's DHTML scroller in a page when viewed by firefox 1.06. The page address is http://www.sterndriveinc.com.

Any ideas?

08-24-2005, 03:10 AM
It's your Doctype. Remove it and it will work in FF and IE, except you will need to find a new way to center the scroller text*. The script can probably be modified to work with that Doctype but, since the demo page has no Doctype, and it is a complicated third party script. Don't hold your breath for me to do it.

* One Method to center scroller text cross browser without Doctype:

myScroller1.addItem("<center><b>SterndriveInc. The Web's best source for all your Mercuiser/Volvo/OMC needs.</center></b>");
myScroller1.addItem("<center><b>Click here for <a href='http://www.sterndriveinc.com/classifieds.cfm'>Our Current Special Deals.</a></center></b>");
myScroller1.addItem("<center><b>Consult with SterndriveInc about any upgrades you might be considering. We can help.</center></b>");
myScroller1.addItem("<center><b>Looking for something special? Give us a call. Well can locate it for you.</center></b>");
myScroller1.addItem("<center><b>SterndriveInc's experienced marine performance specialists are just a phone call away.</center></b>");
myScroller1.addItem("<center><b>We also ship internationally. Let us know what you need.</center></b>");P.S. You might try the author's site for more info.

01-22-2006, 06:13 PM
I am also having the same problem.

I have removed the doctype and indeed it does work.

However, i am very disinclined to remove the doctype and would like to ask:

a) Why does it need to be removed?

b) What alternatives are there for people like us who like Mike's script.


01-23-2006, 05:19 AM
A quick check of the author's web site (http://www.brainjar.com/) reveals that even he is not (or at least not making a point of) supporting this outdated, bloated scroller code. There are many scroller's out there that do not suffer from these problems. Move on.

01-23-2006, 05:26 AM
jscheuer1, thanks for the straight answer.

I have implemented the pause updown scroller on the site (see http://www.tm4bhelp.com/).

If there are better scripts out there than this one, please point me in their direction.

If not, is there any way that most of this javascript can be shifted off to an external js file.


01-23-2006, 05:54 AM
The link in your post is broken but there are many scripts of this type. So many, in fact, that I would not even begin to presume knowledge of which are the best available. However, a scroller is basically just a marquee. So, one great place to start would be with the other scroller and marquee scripts (http://www.dynamicdrive.com/dynamicindex2/index.html) here at DD. A good rule of thumb test as to their suitability for use with a DOCTYPE is to view the source code of the demo page to see if it has one or not. I've made my own mods of a number of the scroller and marquee scripts on DD (I am not affiliated with DD) that extend their usability and adapt for modern DOCTYPE usage. So if you find one here that is authored by DD and just need a tweak or two, I may already have what you want or be able to mod one up rather easily for you.

01-23-2006, 05:56 AM
Thanks John,

The url has a bracket at the end of it by mistake.

It should be http://www.tm4bhelp.com.

Thanks for your kind help - if you could just check on the one i have put up and comment on it, your wise comments would be greatly appreciated.

01-23-2006, 06:44 AM
The page still won't load in IE6 (it redirects to a generic 404 - Page not found message). I made a local copy and that loaded in IE but the scroller looked odd. It wasn't contained within its own borders, rather offset about 50 pixels lower than the container. In Opera8.51 and NS8.0.4 (FF mode), the page looked fine. This is a decent scroller and the main problem with the page in IE, I am sure, has nothing to do with the scroller. What browser do you use?

01-23-2006, 09:41 AM
Thanks for the help John.

With regards to browsers, I use FF and test in IE and NS.

With regards to the redirect 404, that's very strange. How did you make a local copy if the page was redirected?

01-23-2006, 12:29 PM
I used another browser to bring it up first, viewed the source and copied that. It is still:

The page cannot be displayed . . .

in IE6. Actually not the generic 404, rather the Windows OS's own error page.

01-23-2006, 09:19 PM
Sorry for the delayed reply, but i didn't get an email notification when you made your's.

Basically, the 404 was due to bad session handling on my part being redirected to page that doesn't exist. That's been fixed.

With regards to the offset, i have copied the script exactly as found and it is still offset. Any ideas why?

01-23-2006, 10:08 PM
I had to get rid of the scroller temporarily as the site needed to go live today and no time for further developments.

I'll get back to you at a later date to help me sort this out.

Thanks anyhow.

01-23-2006, 10:33 PM
You could always put up a demo page, one not linked to from any other page on your site, and supply the url for that so we could both be testing from the same code.

01-27-2006, 10:02 PM
xhtml 1.0 and firefox doesn't like pixels values without 'px'.

for example in dhtmllib.js file of Mike's scroller :

function moveLayerTo(layer, x, y) {

if (isMinNS4)
layer.moveTo(x, y);
if (ie||dom) {
layer.style.left = x;
layer.style.top = y;

should be :

function moveLayerTo(layer, x, y) {

if (isMinNS4)
layer.moveTo(x, y);
if (ie||dom) {
layer.style.left = x+'px';
layer.style.top = y+'px';

here a fixed version of dhtmllib.js with 'px' string added to every pixels values.

does it work now ?