上一页 1 ··· 11 12 13 14 15
  2017年1月22日
摘要: 最近做很多HTML5的项目,很多页面会通过微信微博等SNS分享出去。在分享页面上提供公司APP的下载。但是在很多应用的浏览器中,点击下载链接无法下载应用。那么针对这些浏览器我们需要给用户提示从safari或者系统自带的浏览器打开分享页面。通过js就可以判断当前页面是在什么浏览器打开的。 以下是一段示 阅读全文
posted @ 2017-01-22 10:19 vsmart 阅读(180) 评论(0) 推荐(0) 编辑
  2017年1月19日
摘要: 方法一: 代码如下: String.prototype.gblen = function() { var len = 0; for (var i=0; i<this.length; i++) { if (this.charCodeAt(i)>127 || this.charCodeAt(i)==94 阅读全文
posted @ 2017-01-19 15:50 vsmart 阅读(361) 评论(0) 推荐(0) 编辑
  2017年1月18日
摘要: <html> <!-- <meta http-equiv="X-UA-Compatible" content="chrome=1"> --> <meta charset="UTF-8"><meta name="viewport" content="width=device-width,user-sc 阅读全文
posted @ 2017-01-18 14:31 vsmart 阅读(309) 评论(0) 推荐(0) 编辑
  2017年1月17日
摘要: document.addEventListener('touchstart',function(ev){ ev.preventDefault();}) 如果页面也a链接或input输入框也同时被阻止了,解决这个办法是 用window.location.href="";及添加阻止冒泡的方法 阅读全文
posted @ 2017-01-17 16:02 vsmart 阅读(281) 评论(0) 推荐(0) 编辑
摘要: function template(wrapParent,data){ var wrapParent = getObj(wrapParent); var tplhtml = getAttr(wrapParent, "data-html"); var tplstr = getObj(tplhtml). 阅读全文
posted @ 2017-01-17 14:21 vsmart 阅读(215) 评论(0) 推荐(0) 编辑
摘要: var SETTINGS = { width : 300, minHeight : 100, title:'请添加标题', content:'请添加文本内容!', mask : true, dragable:false, dir : 'center', opacity : 0.1, cancelBt 阅读全文
posted @ 2017-01-17 14:14 vsmart 阅读(173) 评论(0) 推荐(0) 编辑
摘要: (function setDevice(deviceW){ var html = document.documentElement; var hWidth = html.getBoundingClientRect().width; html.style.fontSize = hWidth/devic 阅读全文
posted @ 2017-01-17 14:05 vsmart 阅读(364) 评论(0) 推荐(0) 编辑
摘要: 单行省略号:display:block;overflow: hidden; text-overflow:ellipsis; white-space: nowrap;多行省略号: display: -webkit-box; -webkit-box-orient: vertical; -webkit-l 阅读全文
posted @ 2017-01-17 13:51 vsmart 阅读(275) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15