- 博客(32)
- 收藏
- 关注
转载 常用npm 模块
lodashmomentrequestglob转载于:https://www.cnblogs.com/byronvis/p/6206982.html
2016-12-21 11:17:00
151
转载 手机端meta标签
<meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0...
2016-09-09 17:01:00
110
转载 原生js实现jquery ready方法
function ready(fn){if(document.addEventListener) {document.addEventListener('DOMContentLoaded', function() {//注销事件, 避免反复触发document.removeEventListener('DOMContentLoaded',arguments.calle...
2016-09-04 12:19:00
145
转载 tabindex=-1让普通元素获得焦点
默认情况下,只有链接元素和表单元素可通过tab按键获得焦点。如果对其它元素使用tabindex属性也可以获得焦点,并可以实现focus()方法。如果其它元素通过tab键获得焦点,只需将tabindex值为-1转载于:https://www.cnblogs.com/byronvis/p/5535666.html...
2016-05-27 18:24:00
493
转载 js获取页面高度
document.documentElement.offsetheight ==>html高度document.documentElement.clientHeight ==> 窗口可见区域高度 document.body.clientHeight ==> body对象高度 document.body.offsetHeight...
2016-05-07 20:29:00
119
转载 $(window).scrollTop()+$(window).height()<=$(document).height()
$(window).scrollTop()+$(window).height()<=$(document).height()转载于:https://www.cnblogs.com/byronvis/p/5469001.html
2016-05-07 19:40:00
484
转载 CSS典型布局
目录:一,水平布局二,垂直布局三,两列布局四,三列布局五,多列布局六,等高布局一,水平布局 1,text-align .parent{ text-align: center; } .child{ display: inline-block; }...
2016-05-01 14:38:00
80
转载 css绘制基本图形
转载 http://www.xuanfengge.com/css3-drawing-various-graphic-effects.html转载于:https://www.cnblogs.com/byronvis/p/5400818.html
2016-04-17 13:03:00
63
转载 h5端css文本溢出加省略号
单行文本溢出 p{ width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }多行文本溢出 p{ width: 100%; overflow: ...
2016-04-17 11:17:00
157
转载 编写高效的css选择器
css选择器的匹配规则是从右向左。和常规思维不同。css选择器限制个数最好不超过4层。Google 资深web开发工程师 Steve Souders 对 CSS 选择器的执行效率从高到低做了一个排序:1.id选择器(#myid)2.类选择器(.myclassname)3.标签选择器(div,h1,p)4.相邻选择器(h1+p)5.子选择器(ul...
2016-04-12 20:17:00
86
转载 jquery插件开发示例(二)
(function(window, $, undefined) { $.fn.sidebar = function(options) { var defaults = { menuoverevent: 'mouseover', menuleaveevent: 'mouseleave', foldevent: 'click',...
2016-02-26 17:03:00
87
转载 (function(window,undefined)(window))
一,将外部的window传到内部函数,避免每次查找window时都要回到函数外部,提升了效率。二,避免用户在函数外部自定义了undefined变量,导致函数内部使用undefined数据类型出错。(自定义undefined变量js不会报错)转载于:https://www.cnblogs.com/byronvis/p/5208995.html...
2016-02-23 10:11:00
96
转载 jquery插件开发示例
/****通用部分 BEGIN *****/$.fn.sidebar = function(options) { var defaults = { event: 'click' }, settings = $.extend({}, defaults, options); return this.each(function() { ...
2016-02-22 21:16:00
81
转载 前端常用插件收藏
1.页面滚动 one-page scroll2.select select2 3.banner焦点图滑动 FlexSlider 4.在线web编辑器 TinyMCE,summernote5.grid插件 ...
2015-12-03 17:33:00
100
转载 style.width,offsetWidth,clientWidth,scrollWidth的区别
style.width,offsetWidth,clientWidth,scrollWidth中只有style.width是可读写,其它都只是可读。其中style.width,offsetWidth是差不多的,style.width的值带单位而offsetLeft不带单位。style.width: 获取或设置 width + padding + borderof...
2015-09-26 17:13:00
205
转载 style.left,offsetLeft,clientLeft,scrollLeft的区别
style.left,offsetLeft,clientLeft,scrollLeft中只有style.left,scrollLeft是可读写,其它都只是可读。其中style.left,offsetLeft是差不多的,left的值带单位而offsetLeft不带单位。这两个属性都必须在position属性为absolute或relative时才有意义。left: ...
2015-09-14 17:52:00
161
转载 div块级元素内文字换行word-wrap, word-break,white-space。
word-wrap: normal; || word-break: normal;当word-wrap或者word-break为normal时,也就是浏览器的默认设置时。换行规则是这样的: 情景一: 当一个单词在行尾不能完整容纳时,会自动将这个单词换到下一行,示例如下。 情景二: 当一个长长的单词在行尾不能完整容纳,并且换行后还...
2015-08-29 12:56:00
501
转载 js设计模式——桥接模式
定义:将抽象化(Abstraction)与实现化(Implementation)脱耦,使得二者可以独立地变化。常用场景:在js中,桥接模式常用于事件监听器和ajax请求的解耦,以便于进行单元测试。举个栗子 普通方法。var btn=$('#btn');btn.on('click',function () { var m...
2015-08-28 15:46:00
83
转载 原生js的Function,Array,Object构造函数的prototype原型方法扩展
在js中,Function构造函数的实例化对象为Function,Array,Object构造函数。<script>Function.prototype.addMethod = function (name,fn) { this.prototype[name]=fn;}Array.addMethod('test',function...
2015-08-28 11:38:00
196
转载 js以字符串方式创建DOM(原生js,jquery,extjs)
原生js利用innerHTML属性实现 <script type="text/javascript"> var divHtml= '<div>'+ '<ul>'+ '<li>'+ '<a href="#">somethi...
2015-08-19 16:54:00
630
转载 js读取服务端json文件的方式——原生js,juqery,extjs
读取json文件只适合同源方式,即ajax方式。读取json数据方式有多种,请求url必须是jsp,php等能够获取请求参数,返回响应的文件。原生js实现function ajaxRequest(type, url, callback) { var type = type, url = url, ...
2015-08-15 17:15:00
465
转载 jquery组件开发
一个简单的侧边栏导航组件。/** * Created by Px.T on 6/22/15. */(function($) { 'use strict'; $.fn.navBar = function(options) { var defaults = { menuData: [], menuC...
2015-07-19 19:06:00
91
转载 js误区——对象的重写与引用对象的解除
本主在练习编写一个简单的js组件时,遇到一个小问题,苦思冥想不得其解,折腾来折腾去才明白原因只是一个误解,记录下来,提醒自己。(调试技术好烂啊!!!基础不牢坑死人!!!)下面附上源码。是一个简单的小组件,在输入框输入文本后会显示输入了多少个字符。 (function(window) { var Input = function(id) { t...
2015-07-05 08:47:00
226
转载 js之类式继承,原型继承,掺元类
类式继承//extend functionfunction extend(subClass,superClass){ var F=function(){}; F.prototype=superClass.prototype; subClass.prototype=new F(); subClass.prototype.constructor=subCl...
2015-05-19 17:38:00
56
转载 js接口的实现
// Interface Constructorvar Interface=function(name,methods){ if(arguments.length!=2){ throw new Error("Interface constructor called with "+arguments.length+"arguments,but expected ex...
2015-05-19 12:47:00
111
转载 CSS水平垂直居中
水平居中文本居中 <style> div{ text-aligh:center } </style> 元素居中 1,margin法 <style>...
2015-05-15 20:16:00
58
转载 CSS清除float浮动
一,添加子元素法 1,添加子空元素 <style> .clear{ clear:both; } </style> <div class="clear"></div> ...
2015-05-15 10:28:00
53
转载 js私有特性,公有特性和特权特性
js中创建对象一般有两种常用方式。一,对象字面量。二,构造函数法 。其中对象字面量方法很简单,在此不必赘述。对于一个对象来说,有属性(attribution)和方法(method),把对象的属性和方法统称起来不妨称为对象的特性(property)。对于对象字面量创建的对象,只有公有特性。对象的属性和方法只要通过点操作符就可以随意访问和修改,对象很容易被破坏...
2015-04-24 10:48:00
152
转载 Linux命令的缩写与全称
(注:来源于网络,整理以便查询。) 学习linux命令行的过程中,如果知道英文全称,会方便理解和记忆~~/bin BINaries/dev DEVices/etc...
2015-03-03 15:26:00
178
转载 linux平台的影音图像处理软件——(windows平台转入linux的选择)
你可能厌烦win各种软件的捆绑,你可能本着某种精神抵制win系统,你可能只想尝试一种新的系统,……不管出于怎么样的原因,现在,你来到了linux。在linux下也有许多图形图像软件不输于win平台,关键是卓越而又免费。(再也不用担心侵权啦~)一,图像处理Gimp VS PhotosShopGimp号称linux下的PS,可以编辑PSD文件格式哦~...
2015-03-02 10:58:00
140
转载 ubuntu,linux mint下刷机教程(解锁+root+刷入recovery+刷入rom)
预备操作本教程为卡刷方式。准备刷机工具adb和fastboot。sudo apt-get install android-tools-adb android-tools-fastboot //安装adb和fastboot工具包解锁说明:华为和三星手机需要解锁操作。不需要解锁的手机可跳过此步骤。首先从官网获取...
2014-12-17 14:59:00
368
转载 js设计模式——单体模式
<!DOCTYPE html><html><head lang="en"> <meta charset="UTF-8"> <title>测试文档</title> <script>// 单体模式的定义:一个只能实例化一次的类,并且提供一个众所周知的全局访问点。//...
2014-12-16 21:55:00
103
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人