Created
January 22, 2014 20:34
-
-
Save jdcauley/8566884 to your computer and use it in GitHub Desktop.
Random Image Load using jQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var images =['1.jpg', '2.jpg', '3.jpg', '4.jpg']; | |
$('#ai-bg').css({'background-image': 'url(assets/images/bg/' + images[Math.floor(Math.random() * images.length)] + ')'}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment