I am trying to make an image (particularly a roulette), rotate via css / javascript, for an application made in Jquery mobile and packaged in phonegap. With the code that I have, in PC, it turns perfectly, but when installing it in the cell phone, it does not. Any solution? I leave the code:
var imgruleta = document.getElementById('imgruleta');
girar.on('tap', function() {
girar.hide();
imgruleta.style.animationName = '';
setTimeout(function(){
imgruleta.className = 'hacergirar';
imgruleta.style.transform = 'rotate(8000deg)';
/*imgruleta.style.animationName = 'girar';*/},500)
if(!primeraEjecucion){
resultado.text('');
}
primeraEjecucion = false;
cont++;
var pos;
do{
pos = Math.floor(Math.random() * vComidas.length);
}while(pos == actual || pos == 0)
actual = pos;
verIngr.hide();
setTimeout(function() {
resultado.text(vComidas[pos].plato);
resultado.show();
girar.show()
girar.val("Girar de nuevo!");
girar.button("refresh");
imgruleta.style.transform = '';
imgruleta.className = '';
$('#ver main').html('');
if(vComidas[pos].ingredientes.length > 0){
verIngr.show();
var h3= $('<h3></h3>');
h3.text(vComidas[pos].plato);
$('#ver main').append(h3);
var divlista = $('<div id="divingr" data-role="listview"></div>');
var p;
var hr;
/*var ul = $('<ul data-role="listview"></ul>');
var li;*/
for(var i in vComidas[pos].ingredientes)
{
p = $('<p class="listaingr"></p>');
p.text(vComidas[pos].ingredientes[i]);
hr = $('<hr />');
divlista.append(p);
divlista.append(hr);
}
$('#ver main').append(divlista);
//divlista('refresh');
div.listview().listview('refresh');
}
else{
verIngr.hide();
}
},5500);
});
.hacergirar{
transition: 5s cubic-bezier(.31,.89,.49,.99);
}
<main role="main" class="ui-content" >
<img src="recursos/imagenes/ruleta2.png" alt="ruleta decididora" id="imgruleta" />
<p id="platoelegido"></p>
<input type="button" value="Girar!" />
<a href="#ver" id="veringr" data-role="button" data-iconshadow="false">Ver ingredientes</a>
</main>