SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Returning variables towards a j-query variable.

    How do i replace this static variable $("#sidebar-button") with some sort of return variable after i click on the a id="sidebar-button" link.

    I want it so you dont have to write out the entire script differently just to have a j-query popdown menu.

    If you would write it a different way please just post that, also correct me if my terminology is in correct.

    J-query
    Code:
    <script>
    $(document).ready(function() {
    $("#sidebar-button").click(function () {
    $("#sidebar-toggle1").toggle();
    });});
    </script>
    HTML / PHP
    Code:
    <a id="sidebar-button">link</a>
    <div id="sidebar-toggle1">stuff</div>
    
    <a id="sidebar-button">link</a>
    <div id="sidebar-toggle2">stuff</div>



    an example of this in action would be http://slickdeals.net/. where you click on one of the deals and a dropdown menu appears.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bump


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
  •