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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -