
常用案例
nobug12138
大前端小学生
展开
-
css3中 百分比宽度减去固定宽度的写法
div{ /*实现了宽度为父容器宽度减去固定的300像素*/ width:-webkit-calc(100% - 300px); width:-moz-calc(100% - 300px); width:calc(100% - 300px); }原创 2017-04-13 10:47:56 · 9954 阅读 · 2 评论 -
CSS3 多行文本溢出省略
`overflow:hidden; text-overflow:ellipsis;display:-webkit-box; -webkit-box-orient:vertical;-webkit-line-clamp:2;`原创 2017-04-24 15:46:53 · 710 阅读 · 2 评论 -
web开发 省市县三级联动
/* * 全国三级城市联动 js版 */function Dsy(){ this.Items = {};}Dsy.prototype.add = function(id,iArray){ this.Items[id] = iArray;}Dsy.prototype.Exists = function(id){ if(typeof(this.Items[id])原创 2017-04-13 14:40:07 · 5159 阅读 · 1 评论 -
微信小程序 选项卡demo
———-demo.wxss————.swiper-tab{ width: 100%; border-bottom: 2rpx solid #777777; text-align: center; line-height: 80rpx;} .swiper-tab-list{ font-size: 30rpx; display: inli原创 2017-04-13 14:36:34 · 1000 阅读 · 0 评论 -
移动页面通过javascript调取手机摄像头和图库
<!DOCTYPE HTML> <html> <head> <title>上传图片</title> <meta charset="utf-8"> </head> <body> <iframe name="uploadfrm" id="uploadfrm" style="display: none;"></iframe> <form na原创 2017-04-13 14:30:46 · 1803 阅读 · 0 评论 -
移动web开发中 ios不兼容fixed
style=”position:fixed;top:38px;bottom:38px;width:100%;overflow:scroll;background-color:#BABABA;” body主体部分添加以上样式原创 2017-04-13 14:27:06 · 544 阅读 · 0 评论 -
iscroll4中滑动页面触发点击事件
找到iscroll.js中: if (target.tagName != ‘SELECT’ && target.tagName != ‘INPUT’ && target.tagName != ‘TEXTAREA’) 修改为: if (target.tagName != ‘SELECT’ && target.tagName != ‘INPUT’ && target.tagName != ‘TEX原创 2017-04-13 14:21:34 · 1173 阅读 · 0 评论 -
web移动前端页面,jquery判断页面滑动方向
/*判断上下滑动:*/ $('body').bind('touchstart',function(e){ startX = e.originalEvent.changedTouches[0].pageX; startY = e.originalEvent.changedTouches[0].pageY; }); $("body").bind("tou原创 2017-04-13 14:18:54 · 3843 阅读 · 4 评论 -
js判断移动终端是android还是ios
<script> var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端 var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //i原创 2017-04-13 14:16:32 · 508 阅读 · 0 评论 -
实现div居中的几种方法
方法一、使用display:table-cell样式<style>.wrapperbox{border:1px solid red; width:100px; height:100px; display:table-cell; font-size:0; text-align:center; vertical-align:middle; *position:relative;padding:0; o原创 2017-04-13 11:32:11 · 773 阅读 · 0 评论 -
css3控制div无限旋转
div{ -webkit-transition-property: -webkit-transform; -webkit-transition-duration: 1s; -moz-transition-property: -moz-transform; -moz-transition-duration: 1s; -webkit-animation: rotate原创 2017-04-13 10:57:49 · 18696 阅读 · 1 评论 -
自定义滚动框
.rows { height: 230px; overflow: hidden; overflow-y: auto;}.rows::-webkit-scrollbar-track-piece { background-color: rgba(0, 0, 0, 0); border-left: 1px solid rgba(0, 0, 0, 0);}.rows::-we...原创 2018-03-27 15:48:27 · 215 阅读 · 0 评论