一、滾動(dòng)到指定位置
$('#scroll_a').click(function() {
$('html,body').animate({
scrollTop: $('#topLink').offset().top
}, 800);
});
二、引入頁(yè)面
1.IFrame引入,看看下面的代碼
<iframe frameborder=0 border=0 width=300 height=300 src="b.htm" mce_src="b.htm"></iframe>
2.<object>方式
[ <object style="border:0px" type="text/x-scriptlet" data="import.htm" width=100% height=30></object>
3.Behavior的download方式
<span id=showImport></span>
<IE:Download ID="oDownload" STYLE="behavior:url(#default#download)" />
<script>
function onDownloadDone(downDate){
showImport.innerHTML=downDate
}
oDownload.startDownload('import.htm',onDownloadDone)
</script>
4.使用JQuery的load方法吧!
$(document).ready(function(){
$(".top").load("top.html");
$(".footer").load("footer.html");
});
三、獲取url鏈接后綴的參數(shù)方法
var hostname = location.protocol + '//' + location.host; 獲取當(dāng)前頁(yè)面域名
function GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r != null) return unescape(r[2]);
return null;
}
var id = GetQueryString('id');
四、定時(shí)自動(dòng)返回上一級(jí)頁(yè)面
function reloadyemian() {
window.location.href = "javascript:history.go(-1)";
}
window.setTimeout("reloadyemian();", 5000);
五、點(diǎn)擊可編輯文案
contentEditable是html中的一個(gè)屬性。設(shè)置html的contentEditable=‘true’時(shí),即可開啟該元素的編輯模式。
<p contenteditable = "true">這是一段可以編輯的文字</p>
哈爾濱品用軟件有限公司致力于為哈爾濱的中小企業(yè)制作大氣、美觀的優(yōu)秀網(wǎng)站,并且能夠搭建符合百度排名規(guī)范的網(wǎng)站基底,使您的網(wǎng)站無(wú)需額外費(fèi)用,即可穩(wěn)步提升排名至首頁(yè)。歡迎體驗(yàn)最佳的哈爾濱網(wǎng)站建設(shè)。
