javascript - jquery get value of input -
my php code
<input style="text-align: center;" id="<?php echo $this->get_field_id("nums"); ?>" name="<?php echo $this->get_field_name("nums"); ?>" type="text" value="<?php echo absint($instance["nums"]); ?>" size='3' />
and jquery:
$(document).ready(function(){ $('.div1').slick({ slidestoshow: 3, slidestoscroll: 1, }); });
how value: slidestoshow = $instance["nums"]
thanks
declare variable global
, can accessed across files(in case php , js on different pages)
$globals['a'] = absint($instance["nums"]); $(document).ready(function(){ $('.div1').slick({ slidestoshow: <?php echo $globals['a'];?> slidestoscroll: 1, }); });
Comments
Post a Comment