Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > mousewheel scrolling stops when loading images via javascript

Thread Tools

mousewheel scrolling stops when loading images via javascript

Posts: n/a
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

The javascript in question is this:

function loadImage(file) {
document.getElementById('foo').src = file;

function showImage() {
if (document.getElementById('foo').complete) {
} 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.getEl ementById('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:

Many thanks in advance for any help.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tk MouseWheel Support Richard Holmes Python 11 03-02-2013 11:14 PM
MouseWheel/IE annoyance Terry Olsen Computer Support 0 05-30-2007 01:34 AM
Make Tkinter canvas respond to MouseWheel event WaterWalk Python 0 03-01-2007 02:08 AM
How do I bind <MouseWheel> to scrollbar? Nicholas Shewmaker Python 1 12-15-2005 05:18 AM
Need a faster MouseWheel Ramon Java 0 12-30-2004 01:57 AM