问题
Anyone else has this problem that select doesn't work good in framework7?
After building apk file select sometimes needs to be changed twice to take effect.
What can cause it ? I removed all external files, and it's sill not working as it should.
<select id="random-select">
<option id="1">1</option>
<option id="2">2</option>
<option id="3">3</option>
<option id="4">4</option>
<option id="5">5</option>
<option id="6">6</option>
</select>
$('#random-select').change(function(){
alert($(this).val());
})
Code is simple as that for select. It's in jquery.
回答1:
This is not an issue with framework7,Actually webkit fast-click is not supported.I faced the same issue and resolved the problem by adding a simple class to select element class="no-fastclick",It will work properly. Another way is to add "fastclick:false" in app init.
回答2:
try this
$(document).ready(function(){
$('#random-select').change(function()
{
alert($(this).val());
});
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select id="random-select" name="selectbox" >
<option id="1">1</option>
<option id="2">2</option>
<option id="3">3</option>
<option id="4">4</option>
<option id="5">5</option>
<option id="6">6</option>
</select>
来源:https://stackoverflow.com/questions/37520765/select-onchange-doesnt-work