aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dojox/fx/tests/test_Shadow.html
blob: fd21fd28ce09c697a40da9a393fe278893b0dd0b (plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>dojox.fx.Shadow - Drop Shadows for DomNodes | The Dojo Toolkit</title>
		
	<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true" ></script>
	<script type="text/javascript" src="../Shadow.js"></script>
	<style type="text/css">
		@import "../../../dojo/resources/dojo.css";
		@import "../../../dijit/themes/dijit.css";
		@import "../../../dijit/themes/tundra/tundra.css";
		@import "../../../dijit/tests/css/dijitTests.css";
	</style>
	<script type="text/javascript">
		dojo.require("dojo.dnd.Moveable");
		dojo.require("dojox.layout.FloatingPane");
		dojo.require("dijit._Calendar"); 
		var enabled = true, randInt=0;
		dojo.addOnLoad(function(){
			
			dojo.query(".hasShadow").forEach(function(n){
				var foo = new dojox.fx.Shadow({ node:n });
				foo.startup();

				if(++randInt%2===0){
					var tmp = new dojo.dnd.Moveable(n);
				}
				
				setTimeout(dojo.hitch(foo,"resize"),4000);
				//setTimeout(dojo.hitch(foo,"setOpacity","0.6",{ duration: 500 }),2000);
				dojo.connect(n,"onmouseover",dojo.hitch(foo,function(){
					this.setOpacity(1);
				}));
				dojo.connect(n,"onmouseout",dojo.hitch(foo,function(){
					if(!dojo.isIE){
						this.setOpacity(0.5);
					}
				}));
				dojo.connect(n,"onclick",dojo.hitch(foo,function(){
					this.setDisabled(!this.disabled);
				}));

			});

			/*
			var div = document.createElement('div');
			var testNode = document.createElement('div'); 

			testNode.appendChild(div);
			div.innerHTML = "Lorem Ipsum";
			dojo.body().appendChild(testNode);

			//dojo.addClass(testNode,"dijitInline"); 

			var aDijit = new dijit._Calendar({},div);
			aDijit.startup();

			var testShadow = new dojox.fx.Shadow({ node: aDijit.domNode }); 
			testShadow.startup(); 
			testShadow.resize();
				*/
		});


	</script>
</head>
<body class="tundra">

	<h1 class="testTitle">dojox.fx.Shadow tests</h1>

	<div>
		<h2>with margin:</h2>
		<div class="hasShadow" style="background:#fff; border:1px solid #a0a0a0; width:100px; height:100px; margin:20px;"> <p>Lorem</p> </div>

		<h2>with padding:</h2>
		<div class="hasShadow" style="background:#fff; border:1px solid #a0a0a0; width:100px; height:100px; padding:10px; "> <p>Lorem</p> </div>

		<h2>no padding:</h2>
		<div class="hasShadow" style="background:#fff; border:1px solid #a0a0a0; width:100px; height:100px;"> <p>Lorem</p> </div>

		<h2>position:absolute</h2>
		<div class="hasShadow" style="background:#fff; border:1px solid #a0a0a0; width:100px; height:100px; position:absolute; top:0px; left:200px; "> <p>Lorem</p> </div>

		<br style="clear:both;">
	</div>

	
	<br><br>


</body>
</html>