I have a first.js file included in the index.php page that has something like this:
$(function(){ $("#my_slider").slider("value", 10); });
And them in index.php I have dynamically created slidders:
<?php function slidders($config, $addon) { $return = ' <script type="text/javascript"> $(function() { $("#slider_'.$addon['p_cod'].'").slider({ min: '.$config['min'].', max: '.$config['max'].', step: '.$config['step'].', slide: function(event, ui) { $("#cod_'.$addon['p_cod'].'").val(ui.value); $(".cod_'.$addon['p_cod'].'").html(ui.value+"'.@$unit.'"); }, change: function(event, ui) { $("#cod_'.$addon['p_cod'].'").change(); } }); $("#cod_'.$addon['p_cod'].'").val($("#slider_'.$addon['p_cod'].'").slider("value")); $(".cod_'.$addon['p_cod'].'").html($("#slider_'.$addon['p_cod'].'").slider("value")+"'.@$unit.'"); }); </script>'; return $return; } ?>
The problem is that my index.php sliders are created after my first.js. I can’t set the value there, is there any event like “after all $ (document) .ready () has completed” that I can use in first.js to control the sliders created in index.php?
jquery
mjsilva Jun 09 '10 at 18:26 2010-06-09 18:26
source share