摘要: 1 class Solution { 2 3 public void printChoices(int[] A, int[][] C) { 4 System.out.println("硬币列表如下:"); 5 for(int i=0,l=A.length; i=2 时 35 // M(i,j) = max( 36 ... 阅读全文
posted @ 2019-04-24 19:04 一三一四君 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 一、概述本文围绕 "jQuery对DOM3 Event 接口的封装" 这一主题,分析DOM3 Event与 jQuery.Event 的异同,阐述 jQuery 对事件对象进行的封装和兼容原理。二、Event1. 标准事件模型的 Event 接口在标准事件模型中,每一种事件都直接或间接实现了 Event 接口,这个接口定义了事件发生时向事件句柄传递的上下文信息,DOM2 Event 接口定义如下:// Introduced in DOM Level 2:interface Event { // PhaseType const unsigned short ... 阅读全文
posted @ 2013-02-16 21:44 一三一四君 阅读(714) 评论(0) 推荐(0) 编辑
摘要: 一、概述本文围绕着 jquery 如何对 css 属性进行读取和设置这个主题,以 MDN/MSDN 文档,以及其它优秀的博文作为参考,对 jquery 1.6.3 中相关的关键性兼容问题做出分析。本文中出现的重要概念有 initial value , specified value , computed value , used value , actual value。重要函数和变量有: getComputedStyle , currentStyle , style , pixelLeft .二、Initial , specified , computed, used and actual 阅读全文
posted @ 2013-01-22 20:51 一三一四君 阅读(366) 评论(0) 推荐(0) 编辑
摘要: 一、前记本文围绕“获取元素的位置” 这一主题,以 jQuery api 中的 offset()、 position()、offsetParent() 三个函数作为切入点 ,分析背后的兼容原理。写本文所测试的浏览器版本分别是: IE6(ietester), IE7,IE8,FF18.0,CHROME23.0.1271.97 m。下文中的浏览器测试结果均只限于这些版本。二、offset()offset 函数返回元素的文档坐标。jQuery 依赖 getBoundingClientRect() 函数获取元素的窗口坐标,之后转换为文档坐标。转换的过程中,需要把窗口坐标的x,y值分别加上文档在x和y轴方 阅读全文
posted @ 2013-01-12 17:27 一三一四君 阅读(1281) 评论(1) 推荐(1) 编辑
摘要: 一. 前言收到教主博客的启发,决定在不支持reduce的浏览器里模拟一下该函数。这里先做一下铺垫:1. 数组里的 undefined 和坑var a = [undefined,,2];a[3] = undefined;a[100] = 99;//出现一个稀疏数组a[0] === undefined;//truea[1] === undefined;//truea[3] === undefined;//truea[50] === undefined;//true0 in a;//true1 in a;//false3 in a;//true50 in a; //false我把 a[1] 和 a[ 阅读全文
posted @ 2012-11-02 00:01 一三一四君 阅读(351) 评论(0) 推荐(0) 编辑