开发者

jquery onblur text

开发者 https://www.devze.com 2022-12-24 04:25 出处:网络
Сервисы <div id=\"services_menu\" class=\"hiddenmenu\"> <div class=\"framemenu\"> <div class=\"itemmenu\"><a href=\"/flights_booking/\" cla开发者_如何学Goss=\"u\" title=\
Сервисы
<div id="services_menu" class="hiddenmenu">
    <div class="framemenu">
        <div class="itemmenu"><a href="/flights_booking/" cla开发者_如何学Goss="u" title="Покупка авиабилетов онлайн">Покупка авиабилетов онлайн</a></div>         
        <div class="itemmenu"><a href="/hotels/" class="u" title="Бронирование гостиниц онлайн">Бронирование гостиниц онлайн</a></div>          
        <div class="itemmenu"><a href="/sea_cruises_search/" class="u" title="Поиск круизов">Поиск круизов</a></div>            
        <div class="itemmenu"><a href="/flights_panel/" class="u" title="Табло аэропортов">Табло аэропортов</a></div>           
    </div>
</div>

$('.services').click(function() {
        $('#services_menu').attr('class') == 'hiddenmenu'  ?   $('#services_menu').attr('class', 'visiblemenu')    :   $('#services_menu').attr('class', 'hiddenmenu');
    });

It's okay.

But...How can I make by clicking on any place on the page, this field disappeared (class a hiddenmenu)

Sorry for bad english. Thank you!


I've just recently done something similar to this.

$('body').click(
  function(){
    // hide whatever
  }
);

Then for whatever you're hiding.

$('.services').click(
  function(e){
    // code
    e.stopPropagation(); // this stops the click event on the body from propagating.
  }
);


Are you looking for this:

$(document).click(function(){
  $('.hiddenmenu').hide();
});


@Isis What about this?

  $(document).live('click', function(){
      $('.hiddenmenu').hide();
    });
0

精彩评论

暂无评论...
验证码 换一张
取 消