I have this piece of code for settings:
<div class="ui-page" id="settings-mode">
<header class="ui-header">
<h2 class="ui-title">Settings</h2>
</header>
<header class="ui-header">
<h2 class="ui-title">Settings</h2>
</header>
<div class="ui-content">
<ul class="ui-listview">
<li class="li-has-radio">
<label>
Test 1
<input type="radio" name="test-mode-radio" value="Test1"/>
</label>
</li>
<li class="li-has-radio">
<label>
Test 2
<input type="radio" name="test-mode-radio" value="Test2"/>
</label>
</li>
<li class="li-has-radio">
<label>
Test 3
<input type="radio" name="test-mode-radio" value="Test3"/>
</label>
</li>
<li class="li-has-radio">
<label>
Test 4
<input type="radio" name="test-mode-radio" value="Test4"/>
</label>
</li>
<ul class="ui-listview">
<li class="li-has-radio">
<label>
Test 1
<input type="radio" name="test-mode-radio" value="Test1"/>
</label>
</li>
<li class="li-has-radio">
<label>
Test 2
<input type="radio" name="test-mode-radio" value="Test2"/>
</label>
</li>
<li class="li-has-radio">
<label>
Test 3
<input type="radio" name="test-mode-radio" value="Test3"/>
</label>
</li>
<li class="li-has-radio">
<label>
Test 4
<input type="radio" name="test-mode-radio" value="Test4"/>
</label>
</li>
</ul>
</div>
</div>
</div>
When I browse to it (using <a href="#settings-mode">), how can I FOCUS to the current selected value (which I select using Javascript)?
I have this code to select the current value:
function onPageBeforeShow() {
pageHelper.resetScroll(page);
page.querySelector('[value="' + currentValue + '"]').checked = true;
}
pageHelper.resetScroll(page);
page.querySelector('[value="' + currentValue + '"]').checked = true;
}
But if it is "Test 4", it is not visible until I manually scroll down...
Thanks
Thanks