Agon
Agon

Reputation: 3

Jquery help,hiding other elements when one is clicked

Can anyone help me with this,basically I want to make my divs hide when the other div is clicked cause I'm using 2 divs in same place but when I click both of them they both open on each other. I was thinking if it's possible to make it so when you click one the other hides

My code:

$(document).ready(function(){

    $('#click').click(function() {
        $('#map').toggle('slow', function() { 

        });
    });

    $('#rubinez').click(function() {
        $('#css3droppanel').toggle('slow', function() { 

        });
    });

    $('#galleryy').click(function() {
        $('#rubb').toggle('1000',function() {

        });
    });
});

Upvotes: 0

Views: 117

Answers (1)

mateo
mateo

Reputation: 11

.next() maybe can help you,

$('.box').live('click',function(){
  $(this).fadeOut(500,function(){
  $(this).next().css('display','block');
});

i dont understand your situation soo i made this http://jsfiddle.net/sejXA/

Upvotes: 1

Related Questions