Associate
- Joined
- 20 Oct 2005
- Posts
- 112
Hi, I'm using a CMS to edit our company website and one of the functions I need is a 'slideshow' macro. The macro works as intended on IE but the slideshow just statically changes image in FireFox and Chrome, there's no fade inbetween. Can anyone see why this is and what I could do to fix it?
Cheers
Code:
<script type="text/javascript"><!--//--><![CDATA[//><!--
var timerID = null;
var timerOn = false;
var visiblemenu = null;
function showmenu(id) {
hidemenu(visiblemenu);
var obj = element(id)
if(obj!=null) {
obj.style.visibility="visible";
visiblemenu = id;
//fade(id+"",10.0,10);
}
}
function hidemenu(id) {
var obj = element(id)
if(obj!=null) {
stopTimer();
//fade(id+"",80,-10);
obj.style.visibility="hidden";
//if(id==visiblemenu)
//visiblemenu=null;
}
}
function startTimer(objid) {
if(timerOn==false) {
timerID=setTimeout("hidemenu('" + objid + "')",300);
timerOn=true;
}
}
function stopTimer() {
if(timerOn) {
clearTimeout(timerID);
timerID = null;
timerOn = false;
}
}
function element(id)
{
if (document.getElementById) return document.getElementById(id);
else if (document.all) return document.all[id];
else return null;
}
function fade(objid,val,dir)
{
setOpacity(element(objid),val);
if(val<90 && dir>0 || val>0 && dir<0)
setTimeout("fade('"+objid+"',"+(val+dir)+","+dir+")",5);
}
function setOpacity(obj,val)
{
obj.style.filter = "ALPHA(opacity="+val+")";
obj.style.mozopacity = val/100.0;
obj.style.opacity = val/100.0;
if(val>0)
obj.style.visibility="visible";
else
obj.style.visibility="hidden";
}
Cheers