我试图让一个 div 在文本框获得焦点时出现,并在文本框失去焦点时消失。这应该发生在 iPad 的纵向模式下(因此检查 w
/*if the search-bar looses focus*/
$("#activate-search").focusout(function(ev){
if (w < h) {
$(".left-pane").hide();
$("#senior-card-container").css("margin-top", "40px");
ev.stopPropagation();
};
});
/*if the search-bar gets focus*/
$("#activate-search").focusin(function(){
if (w < h) {
$(".left-pane").show();
$("#senior-card-container").css("margin-top", "250px");
$(".navbar").css("position", "fixed", "top", "20px");
};
});