Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2005
    Posts
    94
    Thanks
    4
    Thanked 0 Times in 0 Posts

    delay appearance of dropdown menu

    I've got alot of dropdown menu's on each page of a site that I'm working on. They're very simple css driven, but I want to add a time delay to the menu's appearance when you hover over the link.

    Is there a javascript way of inserting a setTimeout() whenever display: none; is changed to display: block?

    Thanks alof for your help in advance.

  • #2
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    Try this:
    Code:
    If (obj.style.display == "none")
    window.setTimeout("displayIt()",delay_time);

  • #3
    New Coder
    Join Date
    May 2005
    Posts
    94
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by BarrMan View Post
    Try this:
    Code:
    If (obj.style.display == "none")
    window.setTimeout("displayIt()",delay_time);
    I'm sorry.. but I really don't get that code at all

  • #4
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    I'll add comments:
    Code:
    If (obj.style.display == "none") //checks if the obj is displayed
    window.setTimeout("displayIt()",delay_time); //sets a timeout for the time delay_time has and calls displayIt function afterwards which then sets the display to block.


  •  

    Posting Permissions

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