suchislife
suchislife

Reputation: 1

JQuery. Click on DIV, display menu. How?

I got a div that is floated right and onClick, I would like to display another DIV containing a list of items that can be clicked on which could also be assigned by id, their own click events. Like a drop down menu for example.

How could I accomplish this?

Upvotes: 1

Views: 1004

Answers (3)

ShibinRagh
ShibinRagh

Reputation: 6656

$("#diva ul li").click(function(){
  $(this).find('#div').slideToggle();
});

Upvotes: 0

Aram Kocharyan
Aram Kocharyan

Reputation: 20431

This looks promising: http://css-tricks.com/simple-jquery-dropdowns/

Upvotes: 1

Sampson
Sampson

Reputation: 268414

If I understand you correctly, you want to show one div when you click another?

$("#diva").on("click", function(){
  $("#divb").toggle();
});

Example: http://jsbin.com/uxaxap/edit#javascript,html

Upvotes: 1

Related Questions