on my site i want to do a custom select. On click i want to slideDown a div, which have some filters. Structure:
<div class="select" style="position:relative;height:20px;">
<span class="label">somelabel</span>
<div style="display:none;position:absolute;top:20px;left:0;" class="select_inner">
<label for="something">
<input type="text" name="something">
</label>
<label for="something">
<input type="text" name="something">
</label>
</div>
</div>
Div with class select_inner is hidden, i want to show it when somebody click on span width class label. And hide when somebody click on everything else except div with class select_inner. And thats the problem... I try something like this:
$('.select').click(function(){
var select = $('.select_inner', this);
select.slideDown();
$(this).parents().click(function(){
select.slideUp();
});
});
And it works but wrong. When i click on my div, child div slides down and instantly up...