回调函数

JavaScript

var msg = $('.msg');
var zooming = new Zooming({
    onBeforeOpen: function () {
        msg.text('onBeforeOpen').show();
    },
    onOpen: function () {
        msg.text('onOpen');
    },
    onBeforeClose: function () {
        msg.text('onBeforeClose');
    },
    onClose: function () {
        msg.text('onClose');
        setTimeout(function () {
            msg.fadeOut()
        }, 1000);
    },
    onBeforeRelease: function () {
        msg.text('onBeforeRelease');
    },
    onRelease: function () {
        msg.text('onRelease');
    },
    onBeforeMove: function () {
        msg.text('onBeforeMove');
    },
    onBeforeGrab: function () {
        msg.text('onBeforeGrab');
    }
});
zooming.listen('.img-zoomable');

HTML

<a href="images/2.jpg">
    <img class="img-zoomable" src="images/2s.jpg" alt="">
</a>
<div class="msg"></div>

dowebok.com 说 明 下 载