2018年1月4日
摘要: //通常点击写法: //新增加的元素 阅读全文
posted @ 2018-01-04 21:52 小碎步 阅读(2232) 评论(0) 推荐(0) 编辑
摘要: /* iphonex适配 */ 阅读全文
posted @ 2018-01-04 21:50 小碎步 阅读(1940) 评论(0) 推荐(0) 编辑
摘要: //html 在iOS Safari中,剪贴板API有一些限制(实际上是安全措施): 于安全原因,iOS Safari只允许容器中的document.execCommand('copy')文本contentEditable。 解决方法是检测iOS Safari,并contentEditable在执行 阅读全文
posted @ 2018-01-04 21:49 小碎步 阅读(875) 评论(0) 推荐(0) 编辑
摘要: 一. 建一个文件夹webpack_test 二. 在webpack_test内 建2个文件,webpack.config.js,package.json 1.通过配置文件来使用webpack 在当前练习文件夹的根目录下新建一个名为webpack.config.js的文件,我们在其中写入如下所示的简单 阅读全文
posted @ 2018-01-04 21:48 小碎步 阅读(137) 评论(0) 推荐(0) 编辑
摘要: .a{ position: fixed; top: 30px; width: 100%; height: 15px; margin-top: 10px; z-index: 10; background: -webkit-linear-gradient(#ffffff 50%, rgba(255, 255, 255, 0)); ba... 阅读全文
posted @ 2018-01-04 21:44 小碎步 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 遇到这个属性,是在给video 嵌入一个div时,导致video播放器上下有灰色。在控制台查看video默认样式的时候看到了这个属性。 播放器上下的灰色,不是我们想要的样式,如果能完全覆盖就更好了。 下图是我用object-fit:fill进行修改的 阅读全文
posted @ 2018-01-04 21:43 小碎步 阅读(8392) 评论(0) 推荐(0) 编辑
摘要: 在微信浏览器、苹果等其他浏览器,里面使用video标签,会自动变成全屏,改成下面就好了,起码可以在video标签之上加入其他元素 webkit-playsinline playsinline x5-playsinline x-webkit-airplay="allow"; 如: <video src 阅读全文
posted @ 2018-01-04 21:32 小碎步 阅读(6302) 评论(0) 推荐(0) 编辑
摘要: //获取url参数的方法(web) function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).mat 阅读全文
posted @ 2018-01-04 21:31 小碎步 阅读(630) 评论(0) 推荐(0) 编辑
摘要: navigator.userAgent.toLocaleLowerCase().search('micromessenger') > -1 阅读全文
posted @ 2018-01-04 21:31 小碎步 阅读(205) 评论(0) 推荐(0) 编辑
摘要: //如果是火狐浏览器就mousewheelevt=DOMMouseScroll;否则mousewheelevt=mousewheel,因为火狐绑定滚轮事件是DOMMouseScroll 阅读全文
posted @ 2018-01-04 21:27 小碎步 阅读(839) 评论(0) 推荐(0) 编辑
摘要: chrome://inspect/ 阅读全文
posted @ 2018-01-04 21:24 小碎步 阅读(306) 评论(0) 推荐(0) 编辑
摘要: //当img属性src没有值时,会有难看的边框和难看的一个小图 有什么办法去掉呢? <img src=" " /> //不要这样写 <img /> //这样写 然后,css如下 img:not([src]) { opacity: 0; } 可以去掉img的难看的边框和难看的一个小图 阅读全文
posted @ 2018-01-04 21:23 小碎步 阅读(6137) 评论(0) 推荐(0) 编辑
摘要: 重点:text-overflow: ellipsis;只对display:inline;起作用 例子: <span class="a">我说说<b class="b">打瞌睡党风建设打火机</b>说说色儿</span> a{ display:block/inline-block; width:100 阅读全文
posted @ 2018-01-04 21:18 小碎步 阅读(337573) 评论(1) 推荐(12) 编辑
摘要: //获取匹配的 function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 var r = window.location.search.subst 阅读全文
posted @ 2018-01-04 21:14 小碎步 阅读(748) 评论(0) 推荐(0) 编辑
摘要: //点击下载按钮点击统计 $(".btn").click(function(){ (new Image()).src = 'http://xxx.com/xxx.php?id=xxx_clickdown'; //只要修改src }); //访问统计 (修改) (new Image()).src = 阅读全文
posted @ 2018-01-04 21:12 小碎步 阅读(444) 评论(0) 推荐(0) 编辑
摘要: //html结构 //css .upImg { background-image: url(../images/01.png); position: fixed; background-repeat: no-repeat; background-position: center; background-size: cover; z-index: 11; widt... 阅读全文
posted @ 2018-01-04 21:03 小碎步 阅读(1767) 评论(0) 推荐(0) 编辑
摘要: 目的是:通过background的一系列属性,让DIV按照背景图片的比例缩放,并让背景图片填充整个DIV 首先我们需要让背景图片在指定的DIV中全部填充显示 之前看有用类似 background-attachment: 的fix来实现背景图片的填充,但是,貌似是不能按照当前的DIV大小去填充。 我的 阅读全文
posted @ 2018-01-04 21:01 小碎步 阅读(47197) 评论(0) 推荐(0) 编辑
摘要: //判断浏览器 var browser = { versions: function () { var u = navigator.userAgent, app = navigator.appVersion; return { //移动终端浏览器版本信息 mobile: !!u.match(/AppleWe... 阅读全文
posted @ 2018-01-04 21:00 小碎步 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 上面的代码片断工作正常,提示 “apple”, “orange” … 等,如预期一样。 问题: JSON 字符串 下面的例子中,声明了一个JSON字符串(随附单或双引号)直接地。 var json = '[{"id":"1","tagName":"apple"},{"id":"2","tagName 阅读全文
posted @ 2018-01-04 20:58 小碎步 阅读(287) 评论(0) 推荐(0) 编辑
摘要: (function($) { //生成一个block function createBlock(options) { var defaults = { type: "1", } var options = $.extend(defaults, options); //主元素 v... 阅读全文
posted @ 2018-01-04 20:55 小碎步 阅读(467) 评论(0) 推荐(0) 编辑