mousewheel scrolling stops when loading images via javascript

Discussion in 'Javascript' started by MrMr[iCE], Aug 10, 2003.

  1. MrMr[iCE]

    MrMr[iCE] Guest

    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.
     
    MrMr[iCE], Aug 10, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ramon

    Need a faster MouseWheel

    Ramon, Dec 30, 2004, in forum: Java
    Replies:
    0
    Views:
    368
    Ramon
    Dec 30, 2004
  2. Nicholas Shewmaker

    How do I bind <MouseWheel> to scrollbar?

    Nicholas Shewmaker, Dec 14, 2005, in forum: Python
    Replies:
    1
    Views:
    525
    James Stroud
    Dec 15, 2005
  3. WaterWalk
    Replies:
    0
    Views:
    736
    WaterWalk
    Mar 1, 2007
  4. Richard Holmes

    Tk MouseWheel Support

    Richard Holmes, Mar 10, 2011, in forum: Python
    Replies:
    11
    Views:
    2,035
    Terry Reedy
    Mar 2, 2013
  5. David Mark

    Mousewheel event does not support DOM0 in FF

    David Mark, Jun 2, 2010, in forum: Javascript
    Replies:
    9
    Views:
    161
    David Mark
    Jun 4, 2010
Loading...

Share This Page