Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Sliders, how can i exclude 1 slider from a jQuery('.slider').each(function()
    primarykey
    data
    text
    <p>I have 3 sliders that are used calculate a number of MB used online. The total MB is translated to GB and a total slider is created and adjusted to reflect the total. I am using a jQuery('.slider').each(function() to find the MB for each slider and then increment the overall total. However, i have 1 of the sliders that i do not want be included in the each function, can i exclude 1 slider from the .each function?</p> <p>how i create the sliders:</p> <pre><code>// create the sliders and delegate properties. jQuery('#wifi-sl').slider({ min: 0, max: 250, animate: true, range: 'min', step: 10, slide: function (ev, ui) { jQuery('#wifi-value').html(ui.value + ' %'); determineWifi; }, change: function (ev, ui) { jQuery('#wifi-value').html(ui.value + ' %'); determineWifi; } }); jQuery('#email-sl').slider({ min: 0, max: 250, animate: true, range: 'min', step: 10, slide: function (ev, ui) { jQuery('#email-value').html(ui.value + ' emails'); determineData(); }, change: function (ev, ui) { jQuery('#email-value').html(ui.value + ' emails'); determineData(); } }); jQuery('#email-sl').slider({ min: 0, max: 250, animate: true, range: 'min', step: 10, slide: function (ev, ui) { jQuery('#email-value').html(ui.value + ' emails'); slider_id='email-sl'; determineData(); }, change: function (ev, ui) { jQuery('#email-value').html(ui.value + ' emails'); slider_id='email-sl'; determineData(); } }); </code></pre> <p>i don't want the top (first) slider to be counted in the each function below, how can i exclude it?</p> <pre><code>function determineData() { total_data_mb = 0.00; jQuery('.slider').each(function() { var this_data = Math.round( jQuery(this).slider('option', 'value') * jQuery(this).data('data')['units'] * jQuery(this).siblings('.per-select').val() * 100) / 100; jQuery(this).siblings('.slider-data').html(this_data + ' MB'); total_data_mb += this_data; }); total_data_gb = (Math.round( (total_data_mb / 1024) * 100) / 100).toFixed(2); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload