jQuery Quick Flip switch back

这一生的挚爱 提交于 2019-12-24 15:02:16

问题


I'm using the jQuery plugin Quick Flip, but I'm having two issues with one of my pages.

First, I want it to flip when the mouse hovers, which I've been able to do, but I'd also like it to go back to it's original state when you're not hovering. On the jQuery's forum, others are asking the same question, and the creator says it's possible, but won't provide the code for it. I've tried different methods, even playing with a setTimeout to force it back, but I keep breaking the code each time so I'm clearly not doing it right.

Second, it sometimes won't flip back at all when you hover again if the panel contains a link. My example doesn't show this though. Any idea why that happens?

Here is my example: http://kimkellermedia.com/test3/test2.html

Right now the js is:

jQuery(function($){
$('.quickFlip').quickFlip();

for ( var i = 0; i < $.quickFlip.wrappers.length; i++ ) {
    var thisOne = $.quickFlip.wrappers[i];

    $( thisOne.wrapper ).hover( function(ev) {
        var $target = $(ev.target);

        if ( !$target.hasClass('quickFlip') ) $target = $target.parent();

        $target.quickFlipper();

    }, function() {});
}
});

回答1:


If you are using QuickFlip v2.1.1, then you have access to quickFlipper which gives you the functionality you want.

From this blog, Jon Raasch states that you can have the flip occur on the hover event by using the following code:

With $.quickFlipper() the flip can be called in the function of your choice. Let's say we want to trigger the flip effect on hover:

$('.quickflip-wrapper').hover( function(ev) {
    $(ev.target).quickFlipper();
});



回答2:


Felix answered my question with his comment:

http://jsfiddle.net/Ae9Lx/



来源:https://stackoverflow.com/questions/11654503/jquery-quick-flip-switch-back

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!