mousewheel scrolling stops when loading images via javascript

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top