Skip to content

Instantly share code, notes, and snippets.

View markyun's full-sized avatar
😮‍💨
代码成就万世基积沙镇海

云云酱 markyun

😮‍💨
代码成就万世基积沙镇海
View GitHub Profile
@markyun
markyun / gist:7596712
Created November 22, 2013 08:33
css3 动画 Transitions
<!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>

Buoyant Responsive Logo

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.

A Pen by MarkYun on CodePen.

License.

@markyun
markyun / gist:6069099
Created July 24, 2013 09:10
用js取弹出的iframe的页面下的input的值 怎么取
网上找的,极力推崇!在父页面加个隐藏域: <input type="hidden" id="lly" /> upload.jsp使用JS: <script type="text/javascript"> parent.document.getElementById("lly").value="你要传的值"; </script>
@markyun
markyun / gist:6068921
Created July 24, 2013 08:33
<!--[if IE 6]><script>alert("你浏览器弱爆了,哥不带你玩!")</script><![endif]-->
<!--[if IE 6]><script>alert("你浏览器弱爆了,哥不带你玩!")</script><![endif]-->
我们公司还要兼容IE6. 我Tm用的bootstrap啊!!!伤不起啊,。于是我下了一面一段来兼容它:
<!--[if IE 6]><script>alert("你浏览器弱爆了,哥不带你玩!");window.close();</script><![endif]-->
@markyun
markyun / gist:6067806
Created July 24, 2013 03:09
各种取值
根据name取值:
$("input[name='mobile']").val()
根据id取值:
$("#mobile_reg_form").html()
根据name取值了遍历:
$("input[name='mobile']").each(
function(){
@markyun
markyun / gist:6067784
Created July 24, 2013 03:02
全功能js幻灯类库。
/**
* 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){
@markyun
markyun / gist:6061416
Last active April 13, 2024 05:57
国内各大互联网公司相关技术站点2.0版 (集合腾讯、阿里、百度、搜狐、新浪、360等共49个)
国内各大互联网公司相关技术站点2.0版 (集合腾讯、阿里、百度、搜狐、新浪、360等共49个)
利用闲暇时间整理了一份国内各大互联网公司的相关技术站点,希望能够对大家有所帮助,也欢迎各位帮忙补充。
腾讯系列(13) 阿里系列(18) 百度系列(3) 搜狐系列(3) 新浪系列(2) 360系列(2) 其他(9)
腾讯系列(13)
@markyun
markyun / gist:6059668
Created July 23, 2013 03:37
jQuery的代码结构
(function(){
//jQuery变量定义
var jQuery = function(){...};
//jQuery原型定义(包含核心方法)
jQuery.fn = jQuery.prototype = {...};
//看上去很奇怪吧? 非常巧妙的设计,后面详细介绍
jQuery.fn.init.prototype = jQuery.fn;
//提供jQuery静态方法与对象方法的扩展函数
jQuery.extend = jQuery.fn.extend = function(){...};
//后面依次有多个对jQuery静态方法的扩展
@markyun
markyun / gist:6027685
Created July 18, 2013 08:30
previewImage.js //图片上传预览 IE是用了滤镜。 <input type="file" id="upload_file" value="" name="car_loaction1" onchange="previewImage(this)"> <a class="thumbnail" href="#" id="preview"> <img alt="" src="http://placehold.it/160x120"> </a>
//图片上传预览 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>';
@markyun
markyun / gist:5963932
Created July 10, 2013 06:40
深入理解JavaScript定时机制
JavaScript的setTimeout与setInterval是两个很容易欺骗别人感情的方法,因为我们开始常常以为调用了就会按既定的方式执行, 我想不少人都深有同感, 例如:
setTimeout(function() {
alert('你好!');
}, 0);
setInterval(callbackFunction, 100);
认为setTimeout中的问候方法会立即被执行,因为这并不是凭空而说,而是JavaScript API文档明确定义第二个参数意义为隔多少毫秒后,回调方法就会被执行. 这里设成0毫秒,理所当然就立即被执行了.
同理对setInterval的callbackFunction方法每间隔100毫秒就立即被执行深信不疑!