I have a problem with a button. I have searched the archive, but coudn't seem to find a proper solution.
I would like the button to open and close the header and at the same time I also wan't to close the header when clicked outside the header
As you can see on my example: http://www.danieldoktor.dk/test/test.html
I can't get it to function correctly.
Here's the code I can't get to work.
<div class="lists">
<header class="box_header" id="box1">
<h1>HEADER 1</h1>
<div class="setting" id="btn1"></div>
</header>
$(document).ready(function(){
//When mouse rolls over
$("#btn1").click(function () {
$("#box1").stop().animate({height:'100px'},{queue:false, duration:600, easing: 'linear'})
});
//When mouse is removed
$("#btn1").mousedown('', function(){
$("#box1").stop().animate({height:'30px'},{queue:false, duration:1000, easing: 'easeInBack'})
});
$("#box1").hover('', function(){
$("#box1").stop().animate({height:'30px'},{queue:false, duration:1000, easing: 'easeInBack'})
});
Can any of you help?
Daniel