SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: js help, please

  1. #1
    SitePoint Member
    Join Date
    Sep 2001
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    js help, please

    I don't know how to change the script here -

    http://www.dynamicdrive.com/dynamici...lideinmenu.htm

    - to make it slide in from the right. I would really appreciate it if someone could show me how, or post the changed code. Thank you!
    mutatis mutandis

  2. #2
    I have an opinion...
    Join Date
    Sep 2001
    Location
    Barrie, Ontario
    Posts
    324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In order to have it slide in from the right, you would have to know/specify the width of the browser window. If you can do that, then it is just a matter of changing the start location and direction of movement for the layer.
    Egotist: A person more interested in himself than in me.
    KodeKrash - Eidix - Barrie LUG

  3. #3
    SitePoint Member
    Join Date
    Sep 2001
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    thanks

    Thank you, but how do I change the direction? That's what I wanted to know.
    mutatis mutandis

  4. #4
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi siren,

    For one you would have to change the 'pullengine()' function:

    function pullengine(){
    if (ie4&&themenu.pixelLeft<rightboundary)
    themenu.pixelLeft+=5

    in the above snippet, the menu's left boundary (pixelLeft) is being compared to the arbitrarily set 'rightboundary' variable. And if the comparison returns true, 5 pixels are added to the left boundary.

    now, to make it slide from the right to the left, you have to:
    1) calculate where your menu's left boundary is (pixelLeft)
    2) determine how far left you want the menu to slide (leftboundary instead of rightboundary)
    3) subtract x pixels from pixelLeft if you comparison returns true -- remember the left side of the screen is where the x-axis begins (think of high school geometry -- you know, that course you cut in your sophmore year because it was useless and boring
    so the numbers will be higher on the right side of the screen.

    If you don't understand the above & kodekrash's (hi
    suggestions, I'm usually at the javascript city forums.
    Or, you can post your question at the WA forums -- where there's a forum specifically for dynamic drive scripts.

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still


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
  •