1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| <script src="http://cdnjs.cloudflare.com/ajax/libs/headjs/1.0.3/head.min.js"></script>
<script>
head.load(
"http://code.jquery.com/jquery-2.1.1.min.js",
function(){
/*
* Le DOM est construit, mais il faut initialiser l'objet jQuery
*/
$( function(){ // forme abrégée de $(document).ready(function(){
if ( head.desktop ) {
$( "#exemple" ).css({
"position" : "absolute",
"top" : "0px",
"right" : "0px",
"width" : "200px",
"height" : "200px",
"background-color" : "rgb(27, 200, 68)",
"z-index" : "99"
});
}
if ( head.mobile ) {
$( "#exemple" ).css({
"position" : "absolute",
"top" : "0px",
"left" : "0px",
"width" : "100%",
"height" : "200px",
"background-color" : "rgb(27, 200, 68)",
"z-index" : "99"
});
}
});
}
);
</script> |
Partager