Thread: DHTML problem

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    8
    Rep Power
    0
    Hi people,

    I'm just starting with DHTML and got a problem. It's kinda hard to explain, but I'm working with slideouts, and when a slideout disappears and the other should come, the next slideout first pop-ups for a moment before loading. If nobody understands the question, which I can imagine, the html document is on http://home.wanadoo.nl/joop/DHTML/Dhtml.html.
    Please help me!

    Comments on this post

    • Gran Roguismo agrees
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    Hi ReareFreak - your page was not working so I can not see what is going on there - the source did not help much either -

    Anyway a general tip is to hide all layers in tour init function and only make them visible the very instant that they are needed
    if the layers are to slide in from offscreen - make sure that they are positioned offscreen before the visibility is turned on .

    Sorry I could be of no further help.

    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    8
    Rep Power
    0
    I'm sorry, put a dot to much in the URL
    I didn't optimize it for NS yet, but in IE it should work fine on this URL: http://home.wanadoo.nl/joop/DHTML/Dhtml.html
    Thanx for your looking.
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    The problem is that the div gets shown before the slide function begins - the code below solves the problem - but is not very efficient - but at least you know where the problem lies (it does work - I tested it)

    function slideoutLeft() {
    if (slideoutShown.xpos > -700) {
    slideoutShown.xpos -= 30
    slideoutShown.left = slideoutShown.xpos
    setTimeout("slideoutLeft()",20)
    }
    else {
    hide(slideoutShown)
    //show(slideoutNew)//## FROM HERE
    setTimeout("slideoutRight()",20)
    }
    }

    function slideoutRight() {
    show(slideoutNew)//###### TO HERE
    if (slideoutNew.xpos < 0) {
    slideoutNew.xpos +=20
    slideoutNew.left = slideoutNew.xpos
    setTimeout("slideoutRight()",20)
    }
    else {
    slideoutShown = slideoutNew
    slideoutActive = 0
    }
    }

    This is not good coding as it forces a show() every time in the loop - but it works for now. Your code 'appears' to position everything off screen but manages to move it onscreen again just before the slide - mess around with that for a bit.


    regards
    Simon



    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL

Similar Threads

  1. Safari DHTML / JavaScript problem
    By servo in forum JavaScript Development
    Replies: 0
    Last Post: November 20th, 2003, 01:24 PM
  2. Stange VIEW problem
    By celyo in forum Firebird SQL Development
    Replies: 0
    Last Post: November 20th, 2003, 02:51 AM
  3. javascript DHTML scrollbar problem in Mozilla
    By mbingu in forum JavaScript Development
    Replies: 0
    Last Post: November 6th, 2003, 04:58 AM
  4. DHTML problem
    By topi77 in forum JavaScript Development
    Replies: 0
    Last Post: January 15th, 2003, 07:54 AM
  5. PHP / Cron / Shell Script problem, help needed
    By badhaiku.dk in forum PHP Development
    Replies: 3
    Last Post: January 9th, 2003, 12:08 PM

IMN logo majestic logo threadwatch logo seochat tools logo