I have the following html
<div id="logoandsearch">
<a class="searchIcon visible-phone" href="javascript:void(0);"><i class="icon-search"></i></a>
<div id="secondaryNav" class="visible-desktop">
<ul>
<li></li>
</ul>
</div>
<div id="top-search">
<div id="top-searchbox">
<asp:TextBox runat="server" ID="txtSearch" autocomplete="off" ClientIDMode="Static" MaxLength="100"></asp:TextBox>
<input type="button" id="btnSearch" value="Search" class="btn btn-inverse" />
</div>
</div>
</div>
<div class="phoneSearchBox" style="display: none">
<input type="text" class="searchtextPhone"/>
<input type="button" class="btn btn-primary btnPhoneSearch" value="Search"/>
</div>
My requirement is when I hover on the "searchIcon" element the div with class "phoneSearchBox" is displayed and a user can enter the text and can hit search button. But when i do this with .hover() event no doubt "phoneSearchBox" is displayed but when i move the mouse out of the "searchIcon" and go to the div "phoneSearchBox" it disappears. I have tried using :
$('.searchIcon, .phoneSearchBox').hover(function () {
$('.phoneSearchBox').show();
}
, function () {
$('.phoneSearchBox').hide();
});
but not able to get this working. Any help to accomplish this is highly appreciated?