問題は、あなたがそれらのバインドを解除せずにイベントを再バインドしていることのようだ:ここ
<script type="text/javascript">
$(document).ready(function() {
//add mouseover event to the search button to show the search box
$(".search").mouseover(
function() {
$(".open").show();
});
//add mouseout event to the search button to show the hide box
$(".search").mouseout(
function() {
$(".open").hide();
});
//add mouseover event to the search box so it doesnt hide when the user attempts to click the box
$(".open").mouseover(
function() {
$(".open").show();
});
//add mouseout event to the search box so it doesnt hides when the users mouse exits the box
$(".open").mouseout(
function() {
$(".open").hide();
});
//don't ever hide the search box when the textbox has focus
$("#tbSearch").focus(
function() {
$(".open").mouseout(
function() {
$(".open").show();
});
});
//hide the search box when the textbox loses focus
$("#tbSearch").blur(
function() {
$(".open").hide();
$(".open").mouseout(
function() {
$(".open").hide();
});
});
});
</script>
とHTMLです。したがって、フォーカスとブラーイベントが何回起こったかによって、ボックスの表示と非表示を切り替える複数のイベントが発生します。私はIEで何らかの理由で失敗している理由を正確には分かっていませんが、解決策にはあまりにも多くの可動部分があるように見えますので、どこが失敗しているのかを正確に伝えるのは難しいです。
私はこれまで、テキストボックスの状態(フォーカスまたはぼかし)を維持する属性を使用して、このタイプのものを動作させることができました。これを試してみてください:
<script type="text/javascript">
$(function() {
var showBox = function() {
$(".open").show();
};
var hideBox = function() {
if (!$(".open").attr("searching")) {
$(".open").hide();
}
};
$(".search").hover(showBox, hideBox);
$(".open").hover(showBox, hideBox).hide();
$("#tbSearch").focus(function() {
$(".open").attr("searching", "true");
}).blur(function() {
$(".open").removeAttr("searching");
$(".open").hide();
});
});
</script>
これは絶対に完璧!おかげで働いていました –