首页 > TAG信息列表 > innerHeight

iframe自适应高度

// iframe自适应高度 $(window).bind("load resize", function() { topOffset = 50; width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width; height = ((this.window.innerHeight > 0) ? this.windo

html5 video全屏播放 自动播放的实现示例

近期开始开发公司新版官网, 首页顶部(header)是一个全屏播放的小视频, 现简单总结如下: 页面代码 <header class="header" style="width:100%;position: relative;"> <?php if(!Helper::isMobile()) { ?> <video id="homeVideo" class="home-video" autoplay

OrthographicCamera当调整窗口resize时变形的解决方法

修改相机的aspect就好了 function onWindowResize() { const aspect = window.innerWidth / window.innerHeight; camera.left = - frustumSize * aspect / 2; camera.right = frustumSize * aspect / 2; camera.top = frustumSize / 2; camera

Vue 上拉加载简单实现

<template> <ul> <li v-for="item in items" :key="item">{{ item }}</li> </ul> </template> <script> // 防抖 const debounce = (fn, delay) => { let timer = null return function (...arg

js 判断是否有滚动条以及获取滚动条宽度的方法

document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight); 一般情况下,使用 document.body.scrollHeight > window.innerHeight 就可以判断。 但是在 IE7,IE8 中 window.innerHeight 为 underfined,所以为了兼容 IE7、IE8,需要使用 docume

jquery中innerheight outerHeight()与height()的区别

1. .height() 获取匹配元素集合中的第一个元素的当前计算高度值 或 设置每一个匹配元素的高度值(带一个参数)。   注意:1).css('height')和.height()之间的区别是后者返回一个没有单位的数值(例如,400),前者是返回带有完整单位的字符串(例如,400px)。 2).height()总是返回内容宽度,不管CSSbo

位置innerHeight

原生js中有三大家族: offset scroll  client       //offset家族中有:offsetLeft  offsetTop  offsetWidth  offsetHeight       //offsetLeft: 元素左外边框距离他的定位父级(offsetParent)左内边框之间的距离.       //offsetTop:  元素上外

vue实现拖拽效果

1、封装拖拽组件 <template> <div @touchstart="down" @touchmove="move" @touchend="end" id="circlebox" class="circle" @click="goHome"> </div></template><script>export defau

H5键盘事件处理

if (/Android/gi.test(navigator.userAgent)) { const innerHeight = window.innerHeight; window.addEventListener('resize', () => { const newInnerHeight = window.innerHeight; if (innerHeight > newInnerHeight) { // 键盘弹出事件处理 } els