M
MrMr[iCE]
I have a strange problem with my site. Im using javascript with DOM to
rewrite content on the browser so I can cut bandwidth on my site. You
can check out the site at http://deathping.kicks-ass.org
The javascript in question is this:
function loadImage(file) {
document.getElementById('foo').src = file;
}
function showImage() {
if (document.getElementById('foo').complete) {
eval(eventcode);
} else {
setTimeout('showImage()', 100);
}
}
function divWrite(div, page) {
if (page==null) {
page = pageNews;
}
document.getElementById(div).innerHTML = page;
if (eventcode != null) {
setTimeout('showImage()', 100);
}
}
When divWrite is called to display an image gallery:
eventcode = "document.getElementById('pic').src=document.getElementById('foo').src;";
eventcode is set by the page functions that generate the html for
divWrite. 'foo' is an image placeholder in a hidden div on the page,
you can view the source to see the img tag.
In sections that have image galleries (Warhammer. Gundam), each time
the page is written by divWrite, the first image would not load. I had
to write the code above so the browser had a chance to load the image
and assign it to 'pic'. The problem here is when the image is done
loading and is assigned to 'pic', the browser window ceases to scroll
by mousewheel anymore. Even if I click on the page, it still wont
scroll. This seems to happen only in mozilla (confirmed with versions
1.1 and 1.5a, IE 6 works fine) I tried self.focus, window.focus, none
seem to do anything to restore mousewheel scrolling. Any ideas what to
do here?
To see the full javascript for the site:
http://deathping.kicks-ass.org/admin/jscript.php
Many thanks in advance for any help.
rewrite content on the browser so I can cut bandwidth on my site. You
can check out the site at http://deathping.kicks-ass.org
The javascript in question is this:
function loadImage(file) {
document.getElementById('foo').src = file;
}
function showImage() {
if (document.getElementById('foo').complete) {
eval(eventcode);
} else {
setTimeout('showImage()', 100);
}
}
function divWrite(div, page) {
if (page==null) {
page = pageNews;
}
document.getElementById(div).innerHTML = page;
if (eventcode != null) {
setTimeout('showImage()', 100);
}
}
When divWrite is called to display an image gallery:
eventcode = "document.getElementById('pic').src=document.getElementById('foo').src;";
eventcode is set by the page functions that generate the html for
divWrite. 'foo' is an image placeholder in a hidden div on the page,
you can view the source to see the img tag.
In sections that have image galleries (Warhammer. Gundam), each time
the page is written by divWrite, the first image would not load. I had
to write the code above so the browser had a chance to load the image
and assign it to 'pic'. The problem here is when the image is done
loading and is assigned to 'pic', the browser window ceases to scroll
by mousewheel anymore. Even if I click on the page, it still wont
scroll. This seems to happen only in mozilla (confirmed with versions
1.1 and 1.5a, IE 6 works fine) I tried self.focus, window.focus, none
seem to do anything to restore mousewheel scrolling. Any ideas what to
do here?
To see the full javascript for the site:
http://deathping.kicks-ass.org/admin/jscript.php
Many thanks in advance for any help.