码迷,mamicode.com
首页 >  
搜索关键字:function    ( 54714个结果
JQuery
1.页面加载就调用的函数 window.onload = function(){ //这里的代码将在页面准备就绪之后开始执行} 此为js写法等价于下面jquery写法 $(window).load(function() { $("#btn-upload").click(function(){ //比 ...
分类:Web程序   时间:2016-05-13 08:37:30    阅读次数:179
(转,记录用)jQuery页面加载初始化的3种方法
jQuery 页面加载初始化的方法有3种 ,页面在加载的时候都会执行脚本,应该没什么区别,主要看习惯吧,本人觉得第二种方法最好,比较简洁。 第一种: [javascript] view plain copy $(document).ready(function(){ alert("第一种方法。"); ...
分类:Web程序   时间:2016-05-13 08:32:01    阅读次数:137
leetcode345——Reverse Vowels of a String(C++)
Write a function that takes a string as input and reverse only the vowels of a string. Example 1:Given s = "hello", return "holle". Example 2:Given s ...
分类:编程语言   时间:2016-05-13 08:30:04    阅读次数:197
leetcode342——Power of Four(C++)
Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example:Given num = 16, return true. Given num = 5, return fa ...
分类:编程语言   时间:2016-05-13 08:24:17    阅读次数:142
动态生成按钮事件绑定
//循环function addList(data){ var $ul = $('.list ul'); for(var i= 0,l=data.length; i<l; i++){ var tmpdata = data[i]; var $li = $('<li></li>'); $li.html( ...
分类:其他好文   时间:2016-05-13 08:07:17    阅读次数:112
leetcode344——Reverse String(C++)
Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 个人博客:http://www.cnblogs.com/ ...
分类:编程语言   时间:2016-05-13 08:04:23    阅读次数:124
根据时间段获取时间段内所有时间点
Date.prototype.format=function (){var s='';s+=this.getFullYear()+'-';// 获取年份。s+=(this.getMonth()+1)+"-"; // 获取月份。s+= this.getDate(); // 获取日。return(s); ...
分类:其他好文   时间:2016-05-13 07:41:12    阅读次数:170
第六十三天请假 PHP封装数据库连接
用类封装数据库连接(unionsql-class.php) 用函数封装数据库连接(unionsql-function.php) ...
分类:数据库   时间:2016-05-13 07:38:05    阅读次数:193
Jquery DIV滚动至浏览器顶部后固定不动代码
$(function(){ //获取要定位元素距离浏览器顶部的距离 var navH = $(".win").offset().top; //滚动条事件 $(window).scroll(function(){ //获取滚动条的滑动距离 var scroH = $(this).scrollTop() ...
分类:Web程序   时间:2016-05-13 07:29:24    阅读次数:152
javascript设计模式--单例模式
单例模式:只允许实例化一次的对象类 这种在基本的编程中可能已经经常的用到,只是不知道是单例模式 比如config.js文件,service.js里都会经常用到:app.factory('payInfo', function($location) { // Might use a resource here that returns a JSON array return { ge...
分类:编程语言   时间:2016-05-13 04:33:49    阅读次数:144
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!