Knockout JS Slide Down and Slide Up Using Check Box

Check box checked event div slide up and slide down

var VM = function () {
    this.visible = ko.observable(true)
};

ko.bindingHandlers.slideIn = {
    init: function (element, valueAccessor) {
        var value = ko.utils.unwrapObservable(valueAccessor());
        $(element).toggle(value);
    },
    update: function (element, valueAccessor) {
        var value = ko.utils.unwrapObservable(valueAccessor());
        value ? $(element).slideDown() : $(element).slideUp();
    }
};

ko.applyBindings(new VM());

Knockout JS Slide Down and Slide Up Using Check Box Knockout JS Slide Down and Slide Up Using Check Box Reviewed by Bhaumik Patel on 7:13 PM Rating: 5