Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>try setting a global attribute when the button is clicked and store this on $('html') like so: </p> <pre><code> $('html'). attr('toggleIs',true); </code></pre> <p>then you can check for this on <em>pagebforeshow</em> and add the toggled state to the buttons on all new pages being pulled into view depending on the button state. </p> <p><strong>EDIT</strong><br> Here is a <a href="http://jsfiddle.net/vSr99/5/" rel="nofollow">jsfiddle</a> (ignore the first alert);</p> <p>Here is the html:</p> <pre><code>$(document).on('change', '.your_select', function(){ // set if( $(this).find('option:selected').val() == "on" ){ $('html').data('toggle', 'on'); } else { $('html').data('toggle', 'off'); } }); $(document).on('pagebeforeshow', '.ui-page', function(){ var that = $(this).find('.your_select'); // clear that.find('option').removeAttr('selected'); // reset if($('html').data('toggle') == "on" ){ alert("should be on") that.find('select option[value="on"]').attr('selected', 'selected') } else { alert("should be off") that.find('option[value="off"]').attr('selected', 'selected') } // refresh slider ... }); </code></pre> <p>please note: </p> <ul> <li>took me a while to see you where using jquery 1.6.4, so my on-bindings didn't work. If you want to keep, you need to use <em>live</em> for the bindings to also capture pages being pulled in. </li> <li>I gave a class to all sliders, to set them together</li> <li>I cannot get the JQM slider('refresh') to work on the slider or any parent element... you will have to figure that out by yourself, but the synchronizing is working :-)</li> </ul>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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