码迷,mamicode.com
首页 >  
搜索关键字:function    ( 54714个结果
Intersection of Two Arrays | & ||
Intersection of Two Arrays Given two arrays, write a function to compute their intersection. Example Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], retur ...
分类:其他好文   时间:2016-06-30 14:05:59    阅读次数:159
理解php中的yield
<?php function gen() { $ret = (yield 'yield1'); var_dump($ret); $ret = (yield 'yield2'); var_dump($ret); } $gen = gen(); var_dump($gen->current()); // ...
分类:Web程序   时间:2016-06-30 12:41:17    阅读次数:149
js函数——倒计时模块和无缝滚动
倒计时 效果: 代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>倒计时函数</title> <script> var timer=(function(){ return function (json) ...
分类:Web程序   时间:2016-06-30 12:29:44    阅读次数:282
ie下不支持placeholder 用jquery来完成兼容
这是我的第一个博客,还是写点正经的,希望对做前端朋友有所帮助。最近在做的项目placeholder不兼容ie,这个可以兼容IE的输入框的HTML新增的placeholder的显示下面是代码:$( document ).ready( function(){ //ie下placeholder的兼容 fu ...
分类:Web程序   时间:2016-06-30 12:28:08    阅读次数:181
计算两个时间差并返回差多少天,时,分,秒
本函数实现两个unix时间戳的差,并返回两个时间戳相差的天、小时、分、秒,精确到秒,两个参数都是时间戳,虽然代码很简单,但是很实用。 function timediff($begin_time,$end_time) { if($begin_time < $end_time){ $starttime ...
分类:其他好文   时间:2016-06-30 12:16:52    阅读次数:211
The plot Function in matlab
from http://pundit.pratt.duke.edu/wiki/MATLAB:Plotting The plot Function The plot function is used to plot sets of data on a 2-D grid. What follows co ...
分类:其他好文   时间:2016-06-30 12:15:44    阅读次数:188
ajax实现jsonp跨域接口
HTML页面代码: <script type="text/javascript"> function UrlSearch(){ var name,value; var str=location.href; //取得整个地址栏 var num=str.indexOf("?") str=str.subs ...
分类:Web程序   时间:2016-06-30 11:00:02    阅读次数:169
js方法中的this
比如有个function: 一个function ServiceMy()的内部的this,就代表这个function本身,具体可以看上面js代码关于myLog和myLog2的注释说明。 关于myLog和myLog2的注释说明: 注意myLog和myLog2这两个function的区别,myLog是全 ...
分类:Web程序   时间:2016-06-30 10:56:07    阅读次数:187
jquery bind live delegate on
1.bind() $(selector).bind(event,[data],function) bind方法给每个$(selector)元素都注册一个事件处理函数,不支持未来增加的元素。上面两段代码等价的。 2.live() $(selector).live(event,[data],functi ...
分类:Web程序   时间:2016-06-30 10:55:12    阅读次数:407
15个jQuery小技巧
下面这些简单的小技巧能够帮助你玩转jQuery。 1、返回顶部按钮 通过使用jQuery中的animate 和scrollTop 方法,不用插件就可以创建一个滚动到顶部的简单动画: // Back to top $('.top').click(function (e) { e.preventDefa ...
分类:Web程序   时间:2016-06-30 09:46:19    阅读次数:184
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!