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
HTML代码: | |
<iframe id="testIframe" frameborder="0" scrolling="no" src="iframe-page-no-fresh.html" width="100%" height="120"></iframe> | |
JS代码: | |
//高度自适应 | |
var iframe = document.getElementById("testIframe"); | |
var iframeHeight = function() { | |
var hash = window.location.hash.slice(1), h; | |
if (hash && /height=/.test(hash)) { | |
h = hash.replace("height=", ""); | |
iframe.height = h; |
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(){ | |
XMLHttpData(); | |
})(); | |
//---------------------------------------------------【AJAX载入歌曲信息】 | |
function XMLHttpData(){ | |
var xmlhttp, | |
song; | |
loadXMLDoc("songData.json"); |
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($){ | |
// Settings | |
var repeat = localStorage.repeat || 0, | |
shuffle = localStorage.shuffle || 'false', | |
continous = true, | |
autoplay = false, | |
playlist = [ | |
{ | |
title: '光辉岁月', | |
artist: '光辉岁月', |
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(){ | |
$("body").append("<div id='main_bg'/>"); | |
$("#main_bg").append("<img src='bg.jpg' id='bigpic'>"); | |
cover(); | |
$(window).resize(function(){ //浏览器窗口变化 | |
cover(); | |
}); | |
}); | |
function cover(){ | |
var win_width = $(window).width(); |
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
/* | |
* Read more here: | |
* http://front-back.com/a-cool-css-spinner-with-less-variables | |
*/ | |
/* | |
* This is a nice full CSS3 loader made with LESS | |
* so you'll have to compile it into CSS to make it work in your project | |
* See the doc on the LESS website : http://lesscss.org/ | |
*/ |
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
RewriteEngine On | |
RewriteRule ^/?Resource/(.*)$ /$1 [L] | |
RewriteRule ^$ /home [redirect] | |
RewriteRule ^([a-zA-Z]+)/?([a-zA-Z0-9/]*)$ /app.php?page=$1&query=$2 [L] |
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:"HTML5", | |
uri:"http://www.w3.org/TR/html5/single-page.html", | |
category:"markup" | |
}, | |
{ | |
name:"HTML 5.1", | |
uri:"http://www.w3.org/TR/html51/single-page.html", | |
category:"markup" |
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
// 判断是否为移动端运行环境 | |
// wukong.name 20130716 | |
if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){ | |
if(window.location.href.indexOf("?mobile")<0){ | |
try{ |
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(){ | |
var chatbox = $(".chatbox").offset().top; | |
$(window).scroll(function (){ | |
var offsetTop = chatbox + $(window).scrollTop() +"px"; | |
$(".chatbox").animate({top : offsetTop },{ duration:800 , queue:false }); | |
}); | |
}) | |
//鼠标经过图片,其他图片渐隐效果 | |
$(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
<div class="imgBox"> | |
<img src="" /> | |
</div> | |
.imgBox { | |
display:table-cell;width:200px;height:200px;vertical-align:middle;text-align:center; | |
*float:left;*font-family:simsun;*font-size:200px;*line-height:1; | |
border:1px solid #000000; | |
} | |
.imgBox img { |