Account gelöscht
Threadersteller
Ort: -
Alter: -
|
Verfasst Mi 11.07.2007 10:23
Titel [javascript] scroll.js funzt in ie - im ff nicht |
|
|
hallo leute...
wie die überschrift schon verrät, hab ich einen scroller auf einer seite integriert, undzwar so:
Zitat: | <div id='news' class='boxed white'>
<h1>1.Halbjahr</h1>
<div id='scroller' class='scroll_up'>
###SCROLLER###
</div>
</div> |
###SCROLLER### ist in typo3 Zitat: | marks.SCROLLER = FILE
marks.SCROLLER.file = fileadmin/scroller.txt |
und aus der txt kommt der inhalt.
soweit, sogut... im ff funzt es super, im ie kommt fehler auf seite in der statusbar und der scroller scrollt nicht!
Hier die js datei:
Zitat: | Scroller.prototype.move=function() {
if (this.mode) {
this.top += (-this.top>=this.cheight ? this.cheight: 0)+this.step;
for (var c=0;c<this.container.length;c++)
this.container[c].style.top=this.top+'px';
}
}
Scroller.prototype.setMode=function(mode) {
this.mode=mode;
}
function Scroller(el,time,step) {
this.element=el;
this.width = parseInt(this.element.offsetWidth);
this.height = parseInt(this.element.offsetHeight);
this.top=0;
this.mode=1;
this.step=step;
this.element.style.overflow='hidden';
this.element.style.position='relative';
this.element.style.top='0px';
// copy element content into master
var content = this.element.childNodes;
var master = document.createElement('div');
master.style.position='relative';
for (t=0;t<content.length;t++) {
master.appendChild(content[t].cloneNode(true));
}
// delete element content
for (t=content.length-1;t>=0;t--)
child = this.element.removeChild(content[t]);
// copy master node c-times (at least 2) to fill the box
var c=0,ready=false;
this.container= new Array();
while (!ready) {
this.container[c]=master.cloneNode(true);
this.element.appendChild(this.container[c]);
c++;
if (c==2)
this.cheight=parseInt(this.container[1].offsetTop)-parseInt(this.container[0].offsetTop);
if (this.cheight)
ready = (this.height<this.cheight*c);
}
window.setInterval2(this,'move',0,time);
var myLinks = this.element.getElementsByTagName('a');
addEvent(myLinks,'mouseover', callLater(this,'setMode',0));
addEvent(myLinks,'mouseout', callLater(this,'setMode',1));
}
addLoadEvent(
function(e) {
map(getElementsByClass('scroll_up','div'),function (e) {new Scroller(e,200,-1);});
}
);
|
schonmal danke
|
|