Derived from am original design by Ryan McLaughlin. Uses cross-browser filters for underwater blur, vw units to make the logo responsive, and CSS animations triggered by window resizes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1———————原生js的写法——— | |
// document.getElementsByClassName("btn") | |
// document.getElementById("btn") | |
// document.getElementsByTagName('div') 查找 | |
//原生js在获取dom元素时,除了document.getElementById()外,其他的方式都会得到一个数组。然后用for循环遍历这个数组的时候,如果对数组里面的元素进行的操作是查找时候的条件或者是删除了这个dom元素,那么这个元素会从数组里面自动移除掉。 | |
window.onload = function() { | |
document.getElementById("btn").onclick = function() { | |
Test(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<body> | |
<div class="a"></div> | |
<div class="a"></div><div class="a"></div> | |
<div class="a"></div><div class="a"></div> | |
<div class="a"></div><div class="a"></div> | |
<div class="a"></div><div class="a"></div> | |
<div class="a"></div><div class="a"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
网上找的,极力推崇!在父页面加个隐藏域: <input type="hidden" id="lly" /> upload.jsp使用JS: <script type="text/javascript"> parent.document.getElementById("lly").value="你要传的值"; </script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--[if IE 6]><script>alert("你浏览器弱爆了,哥不带你玩!")</script><![endif]--> | |
我们公司还要兼容IE6. 我Tm用的bootstrap啊!!!伤不起啊,。于是我下了一面一段来兼容它: | |
<!--[if IE 6]><script>alert("你浏览器弱爆了,哥不带你玩!");window.close();</script><![endif]--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
根据name取值: | |
$("input[name='mobile']").val() | |
根据id取值: | |
$("#mobile_reg_form").html() | |
根据name取值了遍历: | |
$("input[name='mobile']").each( | |
function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* i use closure to simulate private method in OOP,because i don't wanna disturb the others js libraris you may use like jQuery,which uses $ | |
* remember the only variable i inject to window is Slider | |
* | |
* (c)logan liu | |
* Email:hellouniverse@qq.com | |
* if you find bugs,Don't hesitate contacting me. | |
*/ | |
(function(window){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
//jQuery变量定义 | |
var jQuery = function(){...}; | |
//jQuery原型定义(包含核心方法) | |
jQuery.fn = jQuery.prototype = {...}; | |
//看上去很奇怪吧? 非常巧妙的设计,后面详细介绍 | |
jQuery.fn.init.prototype = jQuery.fn; | |
//提供jQuery静态方法与对象方法的扩展函数 | |
jQuery.extend = jQuery.fn.extend = function(){...}; | |
//后面依次有多个对jQuery静态方法的扩展 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//图片上传预览 IE是用了滤镜。 | |
function previewImage(file) | |
{ | |
var MAXWIDTH = 260; | |
var MAXHEIGHT = 180; | |
var div = document.getElementById('preview'); | |
if (file.files && file.files[0]) | |
{ | |
div.innerHTML ='<img id=imghead>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JavaScript的setTimeout与setInterval是两个很容易欺骗别人感情的方法,因为我们开始常常以为调用了就会按既定的方式执行, 我想不少人都深有同感, 例如: | |
setTimeout(function() { | |
alert('你好!'); | |
}, 0); | |
setInterval(callbackFunction, 100); | |
认为setTimeout中的问候方法会立即被执行,因为这并不是凭空而说,而是JavaScript API文档明确定义第二个参数意义为隔多少毫秒后,回调方法就会被执行. 这里设成0毫秒,理所当然就立即被执行了. | |
同理对setInterval的callbackFunction方法每间隔100毫秒就立即被执行深信不疑! |