-
Notifications
You must be signed in to change notification settings - Fork 144
/
target-element-absolute-example.html
59 lines (44 loc) · 1.43 KB
/
target-element-absolute-example.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
56
57
58
59
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>DHTML SnowStorm: targetElement example</title>
<style type="text/css">
#snow-target {
/**
* absolute-positioned example, snow is appended to this element.
* overflow: hidden is recommended for best effect.
*/
position: absolute;
top: 50%;
left: 50%;
width: 20em;
height: 12em;
margin-left: -10em;
margin-top: -6em;
background: #445566;
overflow: hidden;
}
</style>
<script type="text/javascript" src="snowstorm.js"></script>
<script type="text/javascript">
// blue-ish snow!?
snowStorm.snowColor = '#99ccff';
// append the snow to this element (by ID or direct DOM node reference)
snowStorm.targetElement = 'snow-target';
</script>
</head>
<body style="background:#336699;font:100 1.75em helvetica neue, helvetica,arial,verdana,sans-serif;color:#fff">
<h1 style="font-size:1.5em;margin:0px;font-weight:100">SnowStorm: targetElement example (absolute positioning)</h1>
<div id="snow-target">
<div style="padding:0px 0.5em">
<p>
This example has snow moving in an absolutely-positioned <div> element, using <code>snowStorm.targetElement</code>. Applying CSS <code>overflow: hidden</code> to the target element is required for best effect.
</p>
<p>
View the source of this page for reference.
</p>
</div>
</div>
</body>
</html>