- 博客(12)
- 收藏
- 关注
原创 箭头翻转样式
cssspan{width: 20px;height: 20px;display: block;background-image: url(图片url);transition: .2s ease-in-out;-webkit-transition: .2s ease-in-out;-moz-transition: .2s ease-in-out;-o-trans...
2018-11-22 14:13:31 683
原创 html5 video视频在IE下的兼容方式
<script type="text/javascript" src="/js/html5shiv.min.js"></script> <video src="video.mp4" controls="controls"> <!–[if lt IE 8]> &l
2018-11-22 09:44:24 4618
转载 js实现表单提交submit(),onsubmit
通常表单的提交有两种方式,一是直接通过html的form提交,代码如下:<form action="" method="" id="forms"> <input type="text" name="username" value="" /> <input type="password&qu
2018-10-26 10:24:48 1081
翻译 前端页面通过js禁止打开调试模式的方法
<script>//这段js要放在页面最下方 var h = window.innerHeight,w=window.innerWidth; //禁用右键 (防止右键查看源代码) window.oncontextmenu=function(){return false;} //在本网页的任何键盘敲击事件都是无效操作 (防止F12和shift+ctrl+i调起开发者工具...
2018-09-21 09:51:45 10385 3
转载 jq 用each遍历循环
1、选择器+遍历$('div').each(function (i){ i就是索引值 this 表示获取遍历每一个dom对象});2、选择器+遍历$('div').each(function (index,domEle){ index就是索引值 domEle 表示获取遍历每一个dom对象});3、更适用的遍历方法1)先获取某个集合对象2)遍历集合对象的每一个元...
2018-09-19 13:53:29 1144
转载 生成随机的由字母数字组成的字符串
方法一Math.random().toString(36).substr(2);输出:解释很有意思,研究了一下,基本上toString后的参数规定可以是2-36之间的任意整数,不写的话默认是10(也就是十进制),此时返回的值就是那个随机数。若是偶数,返回的数值字符串都是短的,若是奇数,则返回的将是一个很大长度的表示值。 若<10 则都是数字组成,>10 才会包...
2018-09-12 14:32:41 1411
原创 手机端内点击弹出窗口后,同时禁止页面和浏览器滑动
<style type="text/css"> .body_scroll { overflow: hidden; }</style> <script type="text/javascript"> $(".shop_spec").click(function(){ ..
2018-08-30 10:03:07 386
原创 ul 下的li标签都浮动,那么ul的高度用两个css搞定
在ul加入zoom:1;overflow:hidden;ul { zoom:1; overflow:hidden;}
2018-08-02 11:52:09 1530
原创 分页居中ul li居中
两种方式一,利用相对定位和绝对定位。/*分页*/.page{ width: 1400px; height: 40px; position: relative;//先给ul的父亲加上相对定位 margin-top: 50px;}.page ul{ position: absolute;//ul绝对定位 left: 50%;//向右50%...
2018-08-02 11:13:48 355
转载 Vue 绑定class的几种方式
绑定 HTML Class对象语法我们可以传给 v-bind:class 一个对象,以动态地切换 class: <div v-bind:class="{ active: isActive }"></div> 上面的语法表示 active 这个 class 存在与否将取决于数据属性 isActive 的 truthiness。你可以在对象...
2018-07-25 16:30:26 6801
转载 获取select被选中option的value和text
一:javascript原生的方法1:拿到select对象: var myselect=document.getElementById(“test”);2:拿到选中项的索引:var index=myselect.selectedIndex ; // selectedIndex代表的是你所选中项的index3:拿到选中项options的value: myselect.options[in...
2018-07-25 15:24:50 155
转载 字符串只显示首尾字符,中间省略号代替
mb_substr(PHP 4 >= 4.0.6, PHP 5, PHP 7)mb_substr — 获取部分字符串说明string mb_substr ( string $str , int $start [, int $length = NULL [, string $encoding = mb_internal_encoding() ]] )根据字符数执行一个多字节...
2018-07-25 11:42:53 1775
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人