forked from jquery-backstretch/jquery-backstretch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
click.html
55 lines (51 loc) · 1.71 KB
/
click.html
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<style>
body { font-family: Helvetica, Arial, sans-serif; }
.container {
width: 90%;
margin: 20px auto;
background-color: #FFF;
padding: 20px;
}
pre { border: 1px solid #CCC; background-color: #EEE; color: #333; padding: 10px; }
</style>
</head>
<body>
<div class="container">
<h1>Click Demo</h1>
<p>This demonstrates a commonly-asked question: how do I replace Backstretch's image once it's been called? Answer: easy, just call it again!</p>
<p>Furthermore, it gives an example of simple onclick functionality.</p>
<p>
<input type="button" id="pot-holder" value="Show Pot Holder Background" />
<input type="button" id="coffee" value="Show Coffee Background" />
</p>
<pre><code>
<script src="../lib/jquery-1.6.4.min.js"></script>
<script src="../jquery.backstretch.min.js"></script>
<script>
$.backstretch("pot-holder.jpg", {speed: 500});
$("#pot-holder").click(function() {
$.backstretch("pot-holder.jpg");
});
$("#coffee").click(function() {
$.backstretch("coffee.jpg");
});
</script>
</code></pre>
</div>
<script src="../lib/jquery-1.6.4.min.js"></script>
<script src="../jquery.backstretch.min.js"></script>
<script>
$.backstretch("pot-holder.jpg", {speed: 500});
$("#pot-holder").click(function() {
$.backstretch("pot-holder.jpg");
});
$("#coffee").click(function() {
$.backstretch("coffee.jpg");
});
</script>
</body>
</html>