jquery
毅江
这个作者很懒,什么都没留下…
展开
-
$.Event 用法
$.Event 用法最近在使用Bootstrap.js,一不小心趴开源码看了一下,尤其是看到tab.js 1 var hideEvent = $.Event('hide.bs.tab', { 2 relatedTarget: $this[0] 3 }) 4 5 var showEvent = $.Event('show.bs.tab',转载 2016-11-04 18:14:19 · 2001 阅读 · 0 评论 -
$.extend()方法和(function($){...})(jQuery)详解
1. JS中substring与substr的区别之前在项目中用到substring方法,因为C#中也有字符串的截取方法Substring方法,当时也没有多想就误以为这两种方法的使用时一样的。这样就直接按照在C#中使用Substring的方式,直接在js中用了substring,在实际的项目中,有时候能得到正确的结果,但是有时候得到的结果却让人匪夷所思,后来仔细的调试跟踪之后才发现,原来转载 2016-11-02 14:33:24 · 186 阅读 · 0 评论 -
jquery 获取cookie值
cookie有四个不同的属性: 名称,内容,域,路径 代码如下复制代码$.cookie('the_cookie'); // 读取 cookie $.cookie('the_cookie', 'the_value'); // 存储 cookie $.cookie('the_cookie', 'the_value', { expires: 7 });转载 2016-11-18 16:57:45 · 27757 阅读 · 3 评论 -
浏览器窗口失去和获得焦点
$(window).blur(function(){ //your code here console.log('window blur'); });$(window).focus(function(){ //your code here console.log('window fouse'); });原创 2017-06-05 17:51:30 · 10569 阅读 · 0 评论 -
div 高度随窗口动态变化
var resizeDiv = function(){ heightWin = $(window).height(); heightWin2 = document.body.clientHeight; console.log("h1----"+heightWin+'h2---'+ heightWin2); document.getEl原创 2017-08-01 18:07:51 · 684 阅读 · 0 评论