javascript获得页面的可视宽高和页面自身宽高,兼容浏览器. function GetPageSize() { var scrW, scrH; if(window.innerHeight && window.scrollMaxY) { // Mozilla scrW = window.innerWidth + window.scrollMaxX;
当iframe不在父窗口打开时,跳转到父窗口
var parent_url = 'http://www.pecloud.cn'; if(parent.document.URL== document.URL) { window.location.href = parent_url; } else { //... } if(window.top == window) { window.top.location = parent_url; } else { //... }
$(document).ready(function() {
$().mousemove(function(e) {
// display the x and y axis values inside the div with the id XY
$('#XY').html("X Axis : " + e.pageX + " | Y Axis " + e.pageY);
});
<div id="XY"></div>
$("p").size();
if ($('#id').length) {
// do something
}
jQuery.fn.center = function() {
this.css("position","absolute");
this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
$('a[href*=#]').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
&& location.hostname == this.hostname) {
var $target = $(this.hash);
// Reset the font size(back to default)
var originalFontSize = $('html').css('font-size');
$(".resetFont").click(function() {
$('html').css('font-size', originalFontSize);
// Increase the font size(bigger font0
function equalHeight(group) {
tallest = 0;
group.each(function() {
thisHeight = $(this).height();
if (thisHeight > tallest) {
tallest = thisHeight;
jQuery.preloadImages = function() {
for(var i = 0; i < arguments.length; i++) {
$("<img>").attr("src", arguments[i]);
// how to use
PHP中文参考手册 HTML 5 中文手册
JQuery中文手册 CSS 3.0参考手册
HTML参考手册 MySQL参考手册
Smarty中文手册 Apache中文手册
w3school 中文参考手册
Java API 中文参考手册
JavaScript 中文参考手册
Zend_Framework 中文参考手册