-
Notifications
You must be signed in to change notification settings - Fork 0
/
nike.html
158 lines (150 loc) · 5.09 KB
/
nike.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<DOCTYPE html>
<html>
<head>
<style>
* {box-sizing: border-box;}
.img-zoom-container {
position: relative;
}
.img-zoom-lens {
position: absolute;
border: 1px solid #d4d4d4;
/*set the size of the lens:*/
width: 40px;
height: 40px;
}
.img-zoom-result {
border: 1px solid #d4d4d4;
/*set the size of the result div:*/
width: 300px;
height: 300px;
}
</style>
<link type="image/jpg"
rel="icon"
href="Logos\Myntra_logo1.jpg"/>
<title>Myntra-Online Shopping For Men,Women,Kids Fashion & Lifestyle</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script>
function imageZoom(imgID, resultID) {
var img, lens, result, cx, cy;
img = document.getElementById(imgID);
result = document.getElementById(resultID);
/*create lens:*/
lens = document.createElement("DIV");
lens.setAttribute("class", "img-zoom-lens");
/*insert lens:*/
img.parentElement.insertBefore(lens, img);
/*calculate the ratio between result DIV and lens:*/
cx = result.offsetWidth / lens.offsetWidth;
cy = result.offsetHeight / lens.offsetHeight;
/*set background properties for the result DIV:*/
result.style.backgroundImage = "url('" + img.src + "')";
result.style.backgroundSize = (img.width * cx) + "px " + (img.height * cy) + "px";
/*execute a function when someone moves the cursor over the image, or the lens:*/
lens.addEventListener("mousemove", moveLens);
img.addEventListener("mousemove", moveLens);
/*and also for touch screens:*/
lens.addEventListener("touchmove", moveLens);
img.addEventListener("touchmove", moveLens);
function moveLens(e) {
var pos, x, y;
/*prevent any other actions that may occur when moving over the image:*/
e.preventDefault();
/*get the cursor's x and y positions:*/
pos = getCursorPos(e);
/*calculate the position of the lens:*/
x = pos.x - (lens.offsetWidth / 2);
y = pos.y - (lens.offsetHeight / 2);
/*prevent the lens from being positioned outside the image:*/
if (x > img.width - lens.offsetWidth) {x = img.width - lens.offsetWidth;}
if (x < 0) {x = 0;}
if (y > img.height - lens.offsetHeight) {y = img.height - lens.offsetHeight;}
if (y < 0) {y = 0;}
/*set the position of the lens:*/
lens.style.left = x + "px";
lens.style.top = y + "px";
/*display what the lens "sees":*/
result.style.backgroundPosition = "-" + (x * cx) + "px -" + (y * cy) + "px";
}
function getCursorPos(e) {
var a, x = 0, y = 0;
e = e || window.event;
/*get the x and y positions of the image:*/
a = img.getBoundingClientRect();
/*calculate the cursor's x and y coordinates, relative to the image:*/
x = e.pageX - a.left;
y = e.pageY - a.top;
/*consider any page scrolling:*/
x = x - window.pageXOffset;
y = y - window.pageYOffset;
return {x : x, y : y};
}
}
</script>
</head>
<body>
<div class="main">
<div class="topbar"></div>
<div class="social_icon">
<div class="container">
<div class="icon">
<a href="https://www.facebook.com/PranavArya2799"><img src="Logos/facebook_circle-512.png" height="40"></a>
<a href="https://www.instagram.com/pranav_arya37/"><img src="Logos\Instagram_icon.png" height="40"></a>
<a href="https://twitter.com/PranavArya37"><img src="Logos\Twitter.png" height="40"></a>
<a href="https://pranavarya37.wordpress.com/"><img src="Logos\md_5b321ca97f12d.png" height="40"></a>
<a href="mailto:pranavarya2799@gmail.com"><img src="Logos\gmail.png" height="40"></a>
</div>
<div class="header_right">
<div class="login_register_btn">
<a href="#">Login / </a>
<a href="#">Register</a>
</div>
<div class="cart_btn">
<img src="Logos\a2fe7c3cdc704e250aee217c1f59e530.png" height="35">
<span><b>Cart (0)</b></span>
</div>
</div>
</div>
</div>
<div class="header" id="myHeader">
<div class="container">
<div class="logo">
<a href="https://www.myntra.com/"target="_blank"><img src="Logos\Myntra_logo.png" height="50"></a>
</div>
<div class="navbar">
<a href="#">Men</a>
<a href="#">Women</a>
<a href="#">Kids</a>
<a href="#">Home & Living</a>
<div class="search-container">
<form action="https://www.google.com/">
<input type="text" placeholder="Search.." name="search">
<button type="submit" action="https://www.google.com"><i class="fa fa-search"></i></button>
</form>
</div>
</div>
</div>
</div>
<br>
<div class="container">
<div class="product_section_title"><h1>NIKE</h1><br><br></div>
<div class="product_img">
<div class="img-zoom-container">
<img id="myimage" src="1.jpg" width="300px">
<div id="myresult" class="img-zoom-result"></div>
</div>
</div>
<div class="product_text"><br>
<h4><strong>Nike</strong></h4>
<h4>Air Force 1'07LV8 Sport</h4>
<h4><strong>Rs.8995</strong></h4>
<button style="float:left;padding:10px;background-color: hotpink;border-radius: 4px;">Add To Cart</button>
</div>
</div>
<script>
imageZoom("myimage", "myresult");
</script>
</body>
</html>