我是jQuery的新手,在过去的5年中使用过Mootools。我喜欢jQuery ColorBox模式,但我需要将它扩展到inlcude onCancel和onConfirm事件。有人可以指出这些事件如何扩展到ColorBox。
这样的事情:
$(".element").colorbox({
onConfirm:function(){
// some function
},
onCancel:function(){
// some function
}
});
答案 0 :(得分:1)
有回调: http://jacklmoore.com/colorbox/
Callbacks
onOpen false Callback that fires right before ColorBox begins to open.
onLoad false Callback that fires right before attempting to load the target content.
onComplete false Callback that fires right after loaded content is displayed.
onCleanup false Callback that fires at the start of the close process.
onClosed false Callback that fires once ColorBox is closed.