his).next("img.shows").show();}); } }); $("#top_btn").click(function(){if(scroll=="off") return;$("html,body").animate({scrollTop: 0}, 600);}); $(".youhui").mouseover(function(){ $(this).children(".erwm").show(); }) $(".youhui").mouseout(function(){ $(this).children(".erwm").hide(); }); }); $('#open-sb').click(function(){ open_transition._make('','right_to_left','','J_sidebar'); }); $(function(){ $('#J_searchTypeBtn').click(function(event){ event.stopPropagation(); $('#J_searchType').show(); }); $('#J_searchType li').click(function(){ var index = $('#J_searchType li').index(this); if(index==0){ $('#J_from_search').attr('action','/shop/flower'); $('#J_kword_input').attr('placeholder', '输入花店名称或城市名称查找'); }else{ $('#J_from_search').attr('action','/shop/pick_order'); $('#J_kword_input').attr('placeholder', '输入订单所在城市、街道'); } $('#J_searchTypeBtn').html($(this).text()+''); }); $('#J_searchdiquBtn').click(function(event){ event.stopPropagation(); $('#J_searchdiqu').show(); }); $(document).click(function (event) { $('#J_searchType').hide() }); $(document).bind('click', function(e) { var e = e || window.event; //浏览器兼容性 var elem = e.target || e.srcElement; while (elem) { //循环判断至跟节点,防止点击的是div子元素 if (elem.id && elem.id == 'J_searchdiqu') { return; } elem = elem.parentNode; } $('#J_searchdiqu').css('display', 'none'); //点击的不是div或其子元素 }); }) // $( document ).ready(function() { // $.ajaxSetup({ // cache: false // }); // $( '.sidebar' ).simpleSidebar({ // settings: { // opener: '#open-sb', // wrapper: '.wrapper', // animation: { // duration: 500, // easing: 'easeOutQuint' // } // }, // sidebar: { // align: 'right', // width: 200, // closingLinks: 'a', // } // }); // });