前端经验

前端JS判断页面是手机登录还是电脑登录

!DOCTYPE html html head meta http-equiv = Content-Type content = text/html;charset=UTF-8 title 判断手机登录还是电脑登录 / title / head body script type = text/javascript function browserRedirect () { var sUserAgent = navigator.u...

前端经验

css扫描识别动画效果

!DOCTYPE html html head meta charset = UTF-8 title css扫描动画 / title style * { margin : 0 ; padding : 0 ; box-sizing :border-box;} body { height : 100vh ; position :relative;} .scan { width : 150px ; height : 150px ; position :absolut...

前端经验

textarea输入框限制输入字符的方法

!DOCTYPE html html lang = en head meta charset = UTF-8 title textarea限制输入字符 / title / head body textarea name = test onkeyup = textAreaChange(this) onkeydown = textAreaChange(this) rows = 5 / textarea div class = text-right em s...

前端经验

页面实现加载进度条的效果

!DOCTYPE html html lang = en head meta charset = UTF-8 title 进度条 / title style *{ margin : 0 ; padding : 0 ; } #progress { width : 100% ; height : 30px ; background : #00bc12 ; } #bar { width : 1% ; height : 30px ; margin-top : 1px ;...

前端经验

JS实现点击收缩,点击展开效果

!doctype html html lang = en head meta charset = UTF-8 / title 点击收缩,点击展开 / title script src = http://libs.baidu.com/jquery/1.11.3/jquery.min.js / script / head body p span 测试点击展收缩测试点击展收缩测试点击...

前端经验

Javascript下拉刷新效果

!doctype html html head meta charset = utf-8 meta name = viewport content = width=device-width,initial-scale=1,user-scalable=no title 下拉刷新 / title style body { margin : 0 ; position : absolute; width : 100% ;} .loading { line-height...

前端经验

js随机漂浮的广告图片效果代码

!DOCTYPE html html head meta http-equiv = Content-Type content = text/html; charset=utf-8 / title js随机飘动的广告图片代码 / title / head body div id = main style = position:absolute; div style = text-align:right;cursor:pointer;...