<fieldset class="frame-checks-not-standart"> <label> <span class="niceCheck b_n"> <input autofocus type="checkbox" checked="checked" tabindex="1"/> </span> <span class="title">focus checked</span> </label> </fieldset>
b_n
class in styles should have a background-image:none
rule in order to save standard checkboxes when javascript is off. $('.frame-checks-not-standart').nStCheck();
wrapper
(jQuery object)elCheckWrap
(jQuery selector)classRemove
$(elCheckWrap)
(allows you to leave the standard one or use a non-standard checkbox display).evCond
(boolean type)true
the trigger
method will be called, otherwise the after
method will be called;trigger
(method)wrapper
;elCheckWrap
;after
(method)trigger
. If used, the state of the check box does not change, it can be changed directly in the function (this is necessary, for example, if we are waiting for a response from the server);$(elCheckWrap)
- if the method is called as a function. If the method is called in the context of $(elCheckWrap)
, then in the handler function it takes the value of the this
operator. $('.niceCheck').nStCheck('changeCheck')
$.nStCheck('changeCheck')($('.niceCheck'))
_changeCheckStart
checkChecked
checked
attribute, adds the class active
for wrapper and $(elCheckWrap)
;checkUnChecked
checked
attribute, removes the active
class for the wrapper
and $(elCheckWrap)
;changeCheck
checked
attribute if it is positive, and vice versa (a kind of toogle);checkAllChecks
checked
attribute for all transferred objects;checkAllReset
checked
attribute for all transferred objects;checkAllDisabled
disabled
for all objects passed, adds the class disabled
to the wrapper
and $(elCheckWrap)
;checkAllEnabled
disabled
attribute for all passed objects, removes the disabled
class for the wrapper and $(elCheckWrap)
;reset
( form )checkAllReset
method for all previously unselected and checkAllChecks
for the previously selected;mousedown
( input )click
( input )stopPropagation()
method to the event object;keyup
( input )focus
( input )focus
class for $(elCheckWrap)
and wrapper
;blur
( input )focus
class for $(elCheckWrap)
and wrapper
;change
( input )click
( wrapper
)input
that is involved in this plugin, for example: $('input').on('nstcheck.cc', function(e){ console.log(this); // $('input') - , // console.log(e.el); // $(elCheckWrap) });
nstcheck.cc
checkChecked
method;nstcheck.cuc
checkUnChecked
method;nstcheck.ad
checkAllDisabled
method;nstcheck.ae
checkAllEnabled
method.Source: https://habr.com/ru/post/204030/
All Articles