forked from atlemo/SubtlePatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.php
36 lines (31 loc) · 807 Bytes
/
demo.php
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
<?php
$files = glob('*.{png,jpg,jpeg}', GLOB_BRACE);
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Subtle Pattern Demo</title>
<style>
body , html { padding:0;margin:0;height:100%; }
body { background:#ccc none repeat 0 0; }
form { padding:10px;text-align:center;background:#FFF;border-bottom:1px solid #000; }
</style>
</head>
<body>
<form>
<select id="image">
<option><?php echo implode( "</option>\n <option>" , $files ); ?></option>
</select>
</form>
<script src="http://code.jquery.com/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('#image')
.bind('keyup change unfocus blur',function(){
$('body').css( 'background-image' , 'url('+$(this).val()+')' );
})
.blur();
});
</script>
</body>
</html>