-
Notifications
You must be signed in to change notification settings - Fork 0
/
slide.html
85 lines (81 loc) · 2.13 KB
/
slide.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
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign In</title>
<style>
.mainbox
{
position: relative;
background-color: red;
border: 5px solid yellow;
border-radius: 5px;
height: 100px;
}
.left, .right
{
position: absolute;
display: inline-block;
width: 49%;
border: 5px solid black;
}
.left
{
left: 0px;
}
.right
{
right: 0px;
}
.butt{
/* display: inline-block; */
position: absolute;
bottom: 0px;
background-color: blue;
padding: 10px;
color: white;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function()
{
$(".butt").click(function(){
console.log("Click detected");
$(".left").animate({
left: '+=760px'
});
$(".right").animate({
right: '+=760px'
}, "slow");
toogle_classes();
});
function toogle_classes()
{
console.log("inside Toggle Classes");
$(".left").removeClass("left");
$(".right").removeClass("right");
$(".l-dabba").addClass("right");
$(".r-dabba").addClass("left");
$(".right").addClass("r-dabba");
$(".left").addClass("l-dabba")
}
});
</script>
</head>
<body>
<div class="mainbox">
Main box
<br>
<span class="left l-dabba">
Left div
</span>
<span class="right r-dabba">
right div
</span>
<button class="butt">Change</button>
</div>
</body>
</html>