news ticker in Internet Explorer for mac

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
ageorghiou
Forum Newbie
Posts: 12
Joined: Fri Oct 28, 2005 6:25 am

news ticker in Internet Explorer for mac

Post by ageorghiou »

I recently added a news ticker to a site and it all works well except for in internet explorer for mac. I know that IE for mac is discontinued now but my friend that I did it for wants it to work in that as well. I had actually made some php code to generate the text that the news ticker was going to display so I just grabbed a free ticker from online. the code

The code for the ticker is:

Code: Select all

// WebTicker by Mioplanet
// www.mioplanet.com

TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
 
TICKER_RIGHTTOLEFT = false;
TICKER_SPEED = 2;
TICKER_STYLE = "font-family:Arial; font-size:12px; color:#444444";
TICKER_PAUSED = false;

ticker_start();

function ticker_start() {
	var tickerSupported = false;
	TICKER_WIDTH = document.getElementById("TICKER").style.width;
	var img = "<img src=ticker_space.gif width="+TICKER_WIDTH+" height=0>";

	// Firefox
	if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) {
		document.getElementById("TICKER").innerHTML = "<TABLE  cellspacing='0' cellpadding='0' width='100%'><TR><TD nowrap='nowrap'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'>&nbsp;</SPAN>"+img+"</TD></TR></TABLE>";
		tickerSupported = true;
	}
	// IE
	if (navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) {
		document.getElementById("TICKER").innerHTML = "<DIV nowrap='nowrap' style='width:100%;'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'></SPAN>"+img+"</DIV>";
		tickerSupported = true;
	}
	if(!tickerSupported) document.getElementById("TICKER").outerHTML = ""; else {
		document.getElementById("TICKER").scrollLeft = TICKER_RIGHTTOLEFT ? document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth : 0;
		document.getElementById("TICKER_BODY").innerHTML = TICKER_CONTENT;
		document.getElementById("TICKER").style.display="block";
		TICKER_tick();
	}
}

function TICKER_tick() {
	if(!TICKER_PAUSED) document.getElementById("TICKER").scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? -1 : 1);
	if(TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft <= 0) document.getElementById("TICKER").scrollLeft = document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth;
	if(!TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft >= document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth) document.getElementById("TICKER").scrollLeft = 0;
	window.setTimeout("TICKER_tick()", 30);
}
Have any of you dealt with similar problems in ie for mac and found a solution?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

IE5 for Mac is arguably the worst written, most buggy, most inconsistent browser ever written. In most cases, trying to write for IE5(Mac) breaks implementations for most other browsers. Also, in the stats I found, IE5(Mac) was about 0.25% of the browser market.

Long story short - tell you friend not to worry about IE5 for the Mac - ignoring that browser will make it work better for other browsers.


If you can't convince your friend - what exactly is not working? What have you tried?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
ageorghiou
Forum Newbie
Posts: 12
Joined: Fri Oct 28, 2005 6:25 am

Post by ageorghiou »

Pickle, that's the answer I was really looking for. My friend just wrote to me midday yesterday and I was busy with a few other things so I didn't really want to think about it. I had a sense that the ie5(mac) share of the browser market was quite low - on any of the sites I've hosted I've only seen one person every connect using that browser.

I'm of the opinion that it's good to strive for complete compliance but you've got to draw the line somewhere. If only 0.25% of people are using ie5(mac) then it's really probably not worth worrying about. Those few people also have to realize that it's a buggy browser as well and that most sites probably won't work in it.

I'll tell him not to worry about it. If I can't convince him then I'll have to think about it a bit more perhaps and after I've tried a few things I'll write back. The other problem is that I don't have internet explorer on my mac and I don't really want to install it just to check that. :)

Thanks
Post Reply