var myArray = ['horizontal', 'vertical', 'fade'];
I'm trying to make it MODE random.. Couldn't make it
$(document).ready(function(){
$('.bx').b({
mode: 'fade'
auto: true,
});
});
var myArray = ['horizontal', 'vertical', 'fade'];
I'm trying to make it MODE random.. Couldn't make it
$(document).ready(function(){
$('.bx').b({
mode: 'fade'
auto: true,
});
});
You can just use Math.random() to generate an index to use for myArray, e.g.
var id = Math.floor(Math.random()*myArray.length);
...
mode: myArray[id],
...
You just need a function to return a random element from an array:
function rand(arr) {
return arr[Math.floor(Math.random()*arr.length)];
}
Putting it together...
$(document).ready(function(){
$('.bx').b({
mode: rand(myArray)
auto: true,
});
});