Super fast build HTML string
bigCat Posted in JavaScript - 0 CommentThe holy grail!
var arr = ['item 1', 'item 2', 'item 3', ...];
var list = '
- ' + arr.join('
- ') + '
';
http://james.padolsey.com/javascript/fastest-way-to-build-an-html-string/
The holy grail!
var arr = ['item 1', 'item 2', 'item 3', ...];
var list = '
';
http://james.padolsey.com/javascript/fastest-way-to-build-an-html-string/
网页可见区域宽: document.documentElement.clientWidth
网页可见区域高: document.documentElement.clientHeight
网页可见区域宽: document.documentElement.offsetWidth (包括边线的宽)
网页可见区域高: document.documentElement.offsetHeight (包括边线的高)
网页正文全文宽: document.documentElement.scrollWidth
网页正文全文高: document.documentElement.scrollHeight
网页被卷去的高: document.documentElement.scrollTop
网页被卷去的左: document.documentElement.scrollLeft
网页正文部分上: window.screenTop
网页正文部分左: window.screenLeft
屏幕分辨率的高: window.screen.height
屏幕分辨率的宽: window.screen.width
屏幕可用工作区高度: window.screen.availHeight
屏幕可用工作区宽度: window.screen.availWidth
/* 090424 add by bigCat showCaseHover */
var timeOutId; //鼠标移出定时器
jQuery(".showCaseProductBox ul").bind("mouseenter",
function() {
clearTimeout(timeOutId);
jQuery("#companyShowCase").find(".a").remove();
jQuery(this).find(".hint").clone().prependTo(jQuery("#companyShowCase")).addClass("a");
var offset = jQuery(this).offset();
jQuery("#companyShowCase").children(".a").attr("style", function() {
return 'display:block;left:' + (offset.left + 16) + 'px;top:' + (offset.top + 14) + 'px';
});
jQuery("#companyShowCase").find(".a")
.bind("mouseleave", function() {
jQuery(this).remove();
})
.bind("mouseenter", function() {
clearTimeout(timeOutId);
});
});
jQuery(".showCaseProductBox ul").bind("mouseleave",
function() {
timeOutId = setTimeout(function() {
jQuery("#companyShowCase").find(".a").remove();
}, 100);
}
);