码迷,mamicode.com
首页 > 其他好文 > 详细

GIst

时间:2014-12-01 12:40:53      阅读:108      评论:0      收藏:0      [点我收藏+]

标签:style   io   ar   color   sp   for   on   div   bs   

window.onload
 
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != ‘function‘) {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
 
addLoadEvent(prepareGallery);
 
insertAfter

function insertAfter(newElement,targetElement) {
var parent = targetElement.parentNode;
if (parent.lastChild == targetElement) {
parent.appendChild(newElement);
} else {
parent.insertBefore(newElement,targetElement.nextSibling);
}
}

GIst

标签:style   io   ar   color   sp   for   on   div   bs   

原文地址:http://www.cnblogs.com/wallaceyuan/p/4134582.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!