View Full Version : jQuery??

25 Aug 2010, 03:25 PM
Alright so here's what I'm workin on:

a multidemensional menu for an rpg. Now there will be a few buttons which will uses this same effect. I will also need it to close as well.

The effect wanted: The container div's width expands out, and the height expands after,
displaying the items, actions, etc inside it. The menu should close in the reverse fashion height going down to 5px then width going back to 0.

Like I said I would like to use this event a couple times for various buttons. With how I was planning on doing it, it just seems to need too much code for it. So I was curious is there a way I can perform the action once but depending on the Button that was pressed pass a variable to determine which content to grab?

Here my code

the php/html

<h4 class="item">Inventory</h4>
<div class="inventory">
<div id="inventory">

the jQuery
$("#inventory .close").click(function(){


as I said I would like to do the same effect for other buttons as well and would prefer not to use all the jQuery for each class item. Any ideas?

25 Aug 2010, 06:02 PM
Create a function.

function(targetElement, otherStuffYouMightNeed) {

Does that answer your question?