I'm new here and try to get arround the forum a bit. I've just finish a programming class (webforce3) and test all I can to review my classes.
My first question is about a little program/game that seems not to work on mobile devices. Can anyone give me a clue on why is that?
Is it because of the jquery-ui or my code is wrong?
script>
$(function() {
$( "#sortable" ).sortable();
$( "#sortable" ).disableSelection();
});
$(document).ready(function(){
$('ul').each(function(){
// get current ul
var $ul = $(this);
// get array of list items in current ul
var $liArr = $ul.children('li');
// sort array of list items in current ul randomly
$liArr.sort(function(a,b){
// Get a random number between 0 and 10
var temp = parseInt( Math.random()*10 );
// Get 1 or 0, whether temp is odd or even
var isOddOrEven = temp%2;
// Get +1 or -1, whether temp greater or smaller than 5
var isPosOrNeg = temp>5 ? 1 : -1;
// Return -1, 0, or +1
return( isOddOrEven*isPosOrNeg );
})
// append list items to ul
.appendTo($ul);
});
});
</script>
Best is to post the fiddle to see what is happening: https://jsfiddle.net/scooterMaya/ujadw43e/2/
Thanks for any help. I'm trying to anymate a bit my online resume @ http://michelcavro.net