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 to the CF scene
    Join Date
    Aug 2002
    Location
    Romania
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    many <DIV>-s created by JS?

    How can I create 2 or more <div>-s through code? I mean for the onmouseover for the first <div> to show the second <div>. When I did that the 2nd <div> was shown but nothing else!!

  • #2
    New Coder
    Join Date
    Jun 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    More info would be helpful, but I would suggest you write the div's out as html and use JavaScript to control their style.display property. Set it to 'visible' to show the div, and '' to hide the div.

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    Iran
    Posts
    695
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote:

    <p>
    <hr>
    When I did that the 2nd <div> was shown but nothing else!!
    <hr>
    </p>

    I couldn't understand what you mean by this sentence! Anyway, you have to define an Id for each div, then you can call their id from anywhere that you like within your current, or maybe children or parent documents!
    Then you can get the Id by "document.getElementById('yourId')" and do what you want.

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    Iran
    Posts
    695
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote:
    -------------------------------------------------------------------------------
    When I did that the 2nd <div> was shown but nothing else!!
    -------------------------------------------------------------------------------

    I couldn't understand what you mean by this sentence! Anyway, you have to define an Id for each div, then you can call their id from anywhere that you like within your current, or maybe children or parent documents!
    Then you can get the Id by "document.getElementById('yourId')" and do what you want. [/B][/QUOTE]


  •  

    Posting Permissions

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