JavaScript Image Flip
<p>I have some code that is running a JavaScript image flip, I'm new to JS and I need the image to flip when hovered and and hovered off, if I put it to onhover it flips everytime the mouse is moved, not when the mouse is off.</p>

<p>Here is the code:</p>

<pre><code>$(document).ready(function () {
    setInterval(function () {
        $('.sponsorFlip').load('script.js');
        $('.sponsorFlip').load('jquery.flip.min.js');
    }, 30000);
    $('.sponsorFlip').one("mouseenter mouseleave", function () {
        var elem = $(this);
        if (elem.data('flipped')) {
            elem.revertFlip();
            elem.data('flipped', false)
        }
        else {
            elem.flip({
                direction: 'rl',
                speed: 250,
                onBefore: function () {
                    elem.html(elem.siblings('.sponsorData').html());
                }
            });
            elem.data('flipped', true);
        }
    });
    $('.sponsorFlip').bind("click", function () {
        var elem = $(this);
        if (elem.data('flipped')) {
            elem.revertFlip();
            elem.data('flipped', false)
        }
        else {
            elem.flip({
                direction: 'rl',
                speed: 250,
                onBefore: function () {
                    elem.html(elem.siblings('.sponsorData').html());
                }
            });
            elem.data('flipped', true);
        }
    });
});
</code></pre>
