0

I have a slide down menu that uses the following jquery.

$(document).ready(function() {

// Expand Panel
$("#open").click(function(){
    $("div#panel").slideDown("slow");

}); 

// Collapse Panel
$("#close").click(function(){
    $("div#panel").slideUp("slow"); 
});     

// Switch buttons from "Log In | Register" to "Close Panel" on click
$("#toggle a").click(function () {
    $("#toggle a").toggle();
});     

 });

I have a tab at the top.

<!-- The tab on top --> 
<div class="tab">
    <ul class="login">
        <li class="left">&nbsp;</li>
        <li><a href="http://allbuys.ca">AllBuys.ca</a></li>
        <li class="sep">|</li>
        <li id="toggle">
            <a href="#" name="open" class="open" id="open">Pick Your City</a>
            <a id="close" style="display: none;" class="close" href="#">Close Panel</a>         
      </li>
        <li class="right">&nbsp;</li>
    </ul> 
</div> <!-- / top -->

I can't figure out how to make a text link that does the same function as Pick Your City

Any ideas?

2
  • I'm confused. I can't figure out what your question means. What are you trying to do? Could you rephrase it better and maybe give an example? Commented Feb 3, 2011 at 23:04
  • Why not use jQuery's own TAB plugin? It can be found here: docs.jquery.com/UI/Tabs Commented Feb 3, 2011 at 23:16

1 Answer 1

1

You're not really asking a question here. Please be more specific. Also, it would be helpful if you posted some more of your code. Right now we have no idea what the context of this html snippet is.

However, from what I understand you could just make a text link somewhere, no matter where in your page, like this:

<a href='http://a.b.c/' id='make_this_work_as_well'>Link text</a>

Then edit the following jquery line:

$("#open").click(function(){
    $("div#panel").slideDown("slow");
});

to

$("#open,#make_this_work_as_well").click(function(){
    $("div#panel").slideDown("slow");
});
Sign up to request clarification or add additional context in comments.

1 Comment

So simple yet so hard. Thank You Jouke!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.