0
divにホバリングしたときにsIFRテキストが表示されるようにしようとしていますが、遅延があります。jQueryとsIFR。ホバー上で - 遅延と表示
マークアップはこのようなものです、何回か:
<div class="box">
<div class="text">
<h6>sIFR Text</h6>
</div>
</div>
このコードは(ホバーにsIFRに皮から)のトリックをやっているが、遅延なし:
$(document).ready(function() {
$('.text').hide();
$('.box').mouseover(
function() {
$(this).children('.text').show();
//sIFR code :
sIFR.replace(rockwell, {
selector: 'h6',
css: [
'.sIFR-root { color:#FFFFFF; font-size: 1.2em; text-transform: uppercase }',
'a {color: #333333; text-decoration: none;}',
'a:hover {color: #333333;text-decoration:underline;}'
], wmode: "transparent"
}
); //sIFR ends
});
$('.box').mouseout(
function() {
$(this).children('.text').hide();
}
);
});
は、私が使用してみましたhoverIntentプラグインをロードしてこのように使用しても動作していないようですが、動作していないようです:
$(document).ready(function() {
$('.text').hide();
$('.box').hoverIntent(
function() {
$(this).children('.text').show();
//sIFR code should go here
sIFR.replace(rockwell, {
selector: 'h6',
css: [
'.sIFR-root { color:#FFFFFF; font-size: 1.2em; text-transform: uppercase }',
'a {color: #333333; text-decoration: none;}',
'a:hover {color: #333333;text-decoration:underline;}'
], wmode: "transparent"
}
); //sIFR ends
},
function(){
$(this).children('.text').hide();
}
);
});
代替案を指摘していますか? おそらく、setTimeoutは良い選択肢ですが、以前はそれを使用していなかったので、どこに置くべきかはわかりません。
ありがとうございます。
非常にきちんとした、ありがとう! – Peanuts