How to create when user clicks on icon a one field form opens?

Discussion in 'JavaScript' started by Imenica, Sep 29, 2012.

  1. #1
    Hey folks!
    Basically, i need help with one tiny thing.I have a menu with 4 links in it and a small email icon next to it.Here is the code
    <ul id="navigation">
    <li><a href="index.html">Home</a></li>
    <li><a href="about.html">About Us</a> </li>
    <li><a href="services.html">Services</a></li>
    <li><a href="contact.html">Contact</a></li>
    </ul>
    <img src="images/subscribe.png" width="22" height="22">

    Now, when user clicks on this icon, i would need to make one filed form (for email) to slide out (left from icon) and allow user to enter his email and click send.Also, that form should be able to close when clicked again on the icon.
    I know this is a lot of stuff, but is there somebody that could help? :)

    I think this is just a few lines of JS/jQuery, but i dont know it :)
     
    Imenica, Sep 29, 2012 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    Try
    <img src="images/subscribe.png" width="22" height="22" onClick="slide();" />

    Then write a Javascript function named slide() to slide out the form if it's not out or close it if it's out. (You'll need a global variable to keep tracxk of whether it's slid out or not.)
     
    Rukbat, Oct 1, 2012 IP