forked from wilmveel/ui-designer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinputtest.html
72 lines (62 loc) · 1.27 KB
/
inputtest.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
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="js/jquery.js"></script>
<style>
.element {
position: relative;
display: block;
}
.tools {
position: absolute;
display:none;
top:0;
left:0;
cursor: move;
}
.click{
position: absolute;
top:0;
left:0;
background-color: #999;
width:100%;
height:100%;
}
.border{
position: absolute;
top:0;
left:0;
background-color: #DDD;
border: dashed 2px #333;
}
.element:hover .tools{
display:block;
}
</style>
<script>
$( document ).ready(function() {
var element = $( ".template" );
var height = element.outerHeight();
var width = element.outerWidth();
var margin = element.css('margin')
//alert(height + "-" + width);
var tools = $( ".tools" );
tools.height(height);
tools.width(width);
tools.css("margin", margin);
var border = $( ".border" );
border.height(height-4);
border.width(width-4);
});
</script>
</head>
<body>
<element class="element">
<input class="template" class="inp" type="text"></input>
<div class="tools">
<div class="click"></div>
<div class="border"></div>
</div>
</element>
</body>
</html>