javascript - triggering method on a formerly invisible element -
i use 2 jquery plugins slidecontrol , icheck, use script
$(document).ready(function(){ $('.slidecontrol').slidecontrol({ 'lowerbound' : 1, 'upperbound' : 10 }); $('.form-horizontal input').icheck({ checkboxclass: 'icheckbox_flat', radioclass: 'iradio_flat' }); $("input").on("ifchecked",function(e){ $(this).parent().next().removeclass("invisible"); }); });
$(this).parent().next()
has class .slidecontrol
, should display slider, doesn't work. information, ifchecked
corresponds check
event customized icheck
api. tried add
$("input").on("ifchecked",function(e){ $(this).parent().removeclass("invisible"); $('.slidecontrol').slidecontrol({ 'lowerbound' : 1, 'upperbound' : 10 }); });
it didn't work either. in fact, if put last code inside slidecontrol
file slidecontrol.min.js
, works. isn't clean, ?
ok, got it, little tricky : in fact, when ifchecked
not synchronous checking event, had !
$("input").on("ifchecked",function(e){ $(this).parent().addclass('checked'); $(this).parent().removeclass("invisible"); $('.slidecontrol').slidecontrol({ 'lowerbound' : 1, 'upperbound' : 10 }); });
Comments
Post a Comment