glenn
glenn

Reputation: 94

Need DIV to disappear when a separate DIV is clicked

I'm building a site with a home page that has a DIV positioned (fixed) at the top. When the navigation links at the bottom are clicked, a slide activates which jquery to slide up from the bottom. (excuse the messy content for now). What I'd like to happen is whenever a slide is activated and comes up, the top header DIV disappears. (and then re-appears when the slide goes down). Is this possible?

There's a lot of code so I'll just link directly here

Thanks in advance!!

Upvotes: 0

Views: 143

Answers (3)

raddrick
raddrick

Reputation: 4453

<div id="div1"></div>
<div id="div2" onclick="$('#div1').hide()"></div>

or, instead of onclick, just do..

$('#div2').on('click', function(){($'#div1').hide();});

Upvotes: 0

DG3
DG3

Reputation: 5298

In your below jquery function, add $("#mast_head").hide()

$('#menu li a').click(function(e) {
   e.preventDefault();
   $("#mast_head").hide()
   animateSlider(this.hash);
 });

Upvotes: 1

Ayush
Ayush

Reputation: 42440

$(document).ready(function(){
    $('#div1').click(function(){
        $('#div2').hide();
    });
});

Upvotes: 2

Related Questions