vue放大缩小div
<span @click="narrow()"><svg class="fulls-iconfont" aria-hidden="true"><use xlink:href="#bi-cancel-full-screen"></use></svg></span><span @click="enlarge()">&l
·
<span @click="narrow()">
<svg class="fulls-iconfont" aria-hidden="true">
<use xlink:href="#bi-cancel-full-screen"></use>
</svg>
</span>
<span @click="enlarge()">
<svg class="fulls-iconfont" aria-hidden="true">
<use xlink:href="#bi-full-screen"></use>
</svg>
</span>
enlarge() {
var dom= document.getElementById('canvas')
if (dom.requestFullscreen) {
dom.requestFullscreen()
} else if (dom.mozRequestFullScreen) {
dom.mozRequestFullScreen()
} else if (dom.webkitRequestFullscreen) {
dom.webkitRequestFullscreen()
} else if (dom.msRequestFullscreen) {
dom.msRequestFullscreen()
}
this.flag= true
}
narrow() {
if (!this.flag) return
document.exitFullscreen()
this.flag= false
}
更多推荐
已为社区贡献9条内容
所有评论(0)