-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImage Changer.html
48 lines (42 loc) · 1.43 KB
/
Image Changer.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./font-awesome-4.7.0/css/font-awesome.min.css ">
<!-- development version, includes helpful console warnings -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body class="container">
<div id="app">
<div style="margin: 0;padding: 0;display: grid;height: 100%;max-width: 100vh;max-height: 100vh;
margin: auto; ">
<img :src="images[currentImage]" width="750" height="780"/></br></br>
</div>
<div style="object-position:center">
<button class=" btn btn-primaary button":disabled="currentImage===0" href="#" @click="previousImage">Previous</button>
<button class="button btn btm-primary" :disabled="currentImage===(images.length-1)"href="#" @click="nextImage">Next</button>
<div>
</div>
</body>
</html>
<script>
var app =new Vue({
el:"#app",
data:{
images:[""+],
currentImage:0,
},
methods:{
nextImage:function(e){
if(this.currentImage !== (this.images.length-1))
this.currentImage++;
},
previousImage:function(e){
if(this.currentImage !== 0)
this.currentImage--;
},
}
})
</script>