SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Firefox problem

  1. #1
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Firefox problem

    Hi and please help....
    the following script is really ok for IE ( a scrolling imageshow with stop- and left/ right function) but nothing happened in Firefox!!??

    function verScroll(dir, spd, loop) {
    loop = true;
    direction = "left";
    speed = 3;
    scrolltimer = null;
    if (document.layers) {
    var page = eval(document.strip);
    }
    else {
    if (document.getElementById) {
    var page= eval(document.getElementById('strip').style);
    }
    else {
    if (document.all) {
    var page = eval(document.all.strip.style);
    }
    }
    }
    direction = dir;
    speed = parseInt(spd);
    var x_pos = parseInt(page.left);
    if (loop == true) {
    if (direction == "right" && x_pos < 0) {
    page.left = (x_pos + (speed));
    } else {
    if (direction == "left" && x_pos > -1040) {
    page.left = (x_pos - (speed));
    } else{
    if (direction == "left"){
    page.left = -1040;
    }

    }

    }
    scrolltimer = setTimeout("verScroll(direction,speed)", 1);
    }
    }

    function stopScroll() {
    loop = false;
    clearTimeout(scrolltimer);
    }

    Please help, otherwise my boss will kill me later on....:-((

    Jacky.

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He doesn't try to kill you when you use eval() everywhere?

    I think if you look up the specs on eval(), you will find you have your format wrong, and since as far as I can tell eval()'ing all those statements is not necessary in the first place, why are you doing it? Unnecessary function calls slow down your script.

    In addition, if you want people to help you, you should make it as easy as possible. Posting code with no indenting is not the way to go.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •