나는 hoverIntent 플러그인을 작동 시키려고 노력하면서 다음 코드를 쏟아 부었다. 그것은 아주 기본적인 것입니다 (어떤 통합 아이디어라도 있으면 자유롭게 생각해보십시오.) .hover는 잘 작동하지만 .hoverIntent = no 주사위.호버업 기본 문제?
기본적으로 사용자가 미리보기 이미지 위에 마우스를 올려 놓을 때 큰 이미지가 변경되기를 원하지만, 불쾌감을 피하기 위해 몇 가지만 실행하십시오.
내 jQuery를 (업데이트 주로 일하고) 코드 :
function makeShow1(){
$("#some-div img").hide();
$(".uno").show();
}
function makeShow2(){
$("#some-div img").hide();
$(".dos").show();
}
function makeShow3(){
$("#some-div img").hide();
$(".tres").show();
}
function makeShow4(){
$("#some-div img").hide();
$(".quattro").show();
}
function makeShow5(){
$("#some-div img").hide();
$(".cinco").show();
}
function passOut() {
$.(this).stop();
}
$(document).ready(function() {
$(".switch1").hoverIntent({
over: makeShow1,
timeout: 500,
interval: 300,
out: passOut
});
$(".switch2").hoverIntent({
over: makeShow2,
timeout: 500,
interval: 300,
out: passOut
})
$(".switch3").hoverIntent({
over: makeShow3,
timeout: 500,
interval: 300,
out: passOut
})
$(".switch4").hoverIntent({
over: makeShow4,
timeout: 500,
interval: 300,
out: passOut
})
$(".switch5").hoverIntent({
over: makeShow5,
timeout: 500,
interval: 300,
out: passOut
})
});
</script>
, 하나 개의 호버 기능에 – kobe
@gov 여러 수업을하도록 코드를 리팩토링 할 수 있습니다 - 당신은 위의 예에서 hoverIntent을 사용하는 의미와 일했다? 흠 ... 나는 약 100 만 번이나 내 길을 점검했는데 정확하다. 어떤 jQuery 버전을 실행하고 있습니까? – collin
@ 콜린, 아니, 내 프로젝트에 hoverintent 플러그인을 사용했는데, 꽤 괜찮아. jquery 버전은 1.4이다. – kobe