开发者

jQuery multiple clicks on same div with animated click

开发者 https://www.devze.com 2023-03-19 18:04 出处:网络
I have a jQuery animation using hover effects, but then by click display an image and by click hide the image. I would like to be able to add a link within the div for going to a source, however, the

I have a jQuery animation using hover effects, but then by click display an image and by click hide the image. I would like to be able to add a link within the div for going to a source, however, the entire div is controlled by the animate click to close image.

How can I add an href click within the same div? Here's the test development http://mediacrunch.com/nick/animate6.htm

This is the setup code portion before the click events

$(function(){
    $("#wrapperimghov").hi开发者_高级运维de();
    $("#wrapperimghov").fadeIn(6000);
    $("img", this).hide();
    $("png", this).show();
    $(".divhov").hover(animated1, animated2);       
    $(".divhov") .toggle(animated3, animated4);

}
);

function animated1() {

    $( this ).hoverFlow( 'mouseenter', { width: "30px", height:"420px" }, { queue: false, duration: 1000  });

}
function animated2() {

    $( this ).delay(1200) .hoverFlow( 'mouseleave', { width: "10px" , height:"320px" }, { queue: false, duration: 1800});
$("img", this).fadeOut(1800), fadeoutcallback();

}

Now is the click events

    function animated3() {
    $( this ).animate( { width: "420px", height:"420px" }, { queue: false, duration: 800 });
    $("img", this).fadeIn("slow"), fadeoutcallback();
}
function animated4() {
    $( this ).animate( { width: "10px" , height:"320px" }, { queue: false, duration: 800 });
    $("img", this).fadeOut("slow"), fadeoutcallback();

}

function fadeoutcallback(){
$("img", this).hide();
}

So, I am assuming I need another div somehow nested outside of the clickable div, or, this is the million dollar question, can I have another mouse pointer indicating a different state showing the link to href?


http://jsfiddle.net/ave3q/

stop the click event with ev.stopPropagation()

0

精彩评论

暂无评论...
验证码 换一张
取 消