ホームページ  >  記事  >  ウェブフロントエンド  >  w3c 宣言の下で実行でき、js カプレット広告 collection_javascript スキルとの互換性が良好です。

w3c 宣言の下で実行でき、js カプレット広告 collection_javascript スキルとの互換性が良好です。

WBOY
WBOYオリジナル
2016-05-16 18:04:531092ブラウズ

最後我们给出合适的代码:
核心代码:

复制代码 代码如下:

lastScrollY=0;
関数 heartBeat(){
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
diffY = document.documentElement.scrollTop;
else if (document.body)
diffY = document.body.scrollTop
else
{/*Netscape のもの*/}

//alert(diffY);
パーセント=.1*(diffY-lastScrollY);
if(パーセント>0)パーセント=Math.ceil(パーセント);
elsepercent=Math.floor(percent);
document.getElementById("leftDIV").style.top=parseInt(document.getElementById("leftDIV").style.top) パーセント "px";
document.getElementById("rightDIV").style.top=parseInt(document.getElementById("leftDIV").style.top) パーセント "px";

lastScrollY=lastScrollY パーセント;
//alert(lastScrollY);
}

sidebar1= "
"
sidebar2= "
"

ドキュメント。書き込み(サイドバー1);
document.write(sidebar2);

//このセグメントが削除された後、接続は画面に沿って移動しません。
//-->

function closeAD()
{
document.getElementById("leftDIV").style.display='none';
document.getElementById("rightDIV").style.display='none';
}

クラッシュを防ぐために、変更後の代コード:
ゲストのみが右側の代コードを必要とするため、左側の私は空を保持しています。

复制代码代码如下:
lastScrollY=0;
関数 heartBeat2(){
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
diffY = document.documentElement.scrollTop;
else if (document.body)
diffY = document.body.scrollTop
else
{/*Netscape のもの*/}

//alert(diffY);
パーセント=.1*(diffY-lastScrollY);
if(パーセント>0)パーセント=Math.ceil(パーセント);
elsepercent=Math.floor(percent);
document.getElementById("leftDIV2").style.top=parseInt(document.getElementById("leftDIV2").style.top) パーセント "px";
document.getElementById("rightDIV2").style.top=parseInt(document.getElementById("leftDIV2").style.top) パーセント "px";

lastScrollY=lastScrollY パーセント;
//alert(lastScrollY);
}

sidebar1= "
"
sidebar2= "
"

document.write(sidebar1);
document.write(sidebar2);

//このセグメントが削除された後、接続は画面に沿って移動しません。
//-->
function closeAD()
{
document.getElementById("leftDIV2").style.display='none';
document.getElementById("rightDIV2").style.display='none';
}


後来经过网上查找,また発行现了一不错的代码


声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
前の記事:Jqueryプログレスバープラグイン Progress Bar ちょっとした問題解決_jquery次の記事:Jqueryプログレスバープラグイン Progress Bar ちょっとした問題解決_jquery

関連記事

続きを見る