Created
April 14, 2012 14:55
-
-
Save replete/2384987 to your computer and use it in GitHub Desktop.
Change <body> background url through data-attribute
This file contains 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
/* -------------------------------------- */ | |
//Body background | |
var $bodyBackground = $("[data-body-background]:eq(0)"), | |
backgroundURL = $bodyBackground.attr("data-body-background"); | |
if ($bodyBackground.length > 0) { | |
$body | |
.css("background", "url(" + backgroundURL + ") no-repeat top center #000"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment