call internal function
call internal function
Hi, I am tryin to develop some plugin.
this is my start point:
- (function ($) {
$.fn.One_vTest = function (options) {
var defaults = {
isMultiple: false,
isInlineAnswer: true,
ansReplayHolder: "#ansReply",
rightAnswerClass: "rightAns",
rightReplyHolder: "#RightReply",
wrongReplyHolder: "#WrongReply"
}
var options = $.extend(defaults, options);
return this.each(function () {
});
}
})(jQuery);
I want to create internal function and call it when button clicked:
- <script type="text/javascript">
(jQuery)(function ($) {
$("#Questions").One_vTest({
isMultiple: false,
isInlineAnswer: true,
ansReplayHolder: "#Reply",
rightAnswerClass: "rightAns",
rightReplyHolder: "#RightReply",
wrongReplyHolder: "#WrongReply"
});
$("#CheckAns").click(function () {
$("#Questions").One_vTest('open');
});
});
</script>
The idea is create some properties for the plugin and by clicking some button call function 'open'.