中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

網(wǎng)站對(duì)聯(lián)廣告的制作方法

2018-11-01    來源:學(xué)做網(wǎng)站論壇

容器云強(qiáng)勢(shì)上線!快速搭建集群,上萬Linux鏡像隨意使用

很多網(wǎng)站都有對(duì)聯(lián)廣告,當(dāng)我們打開它的網(wǎng)站的時(shí)候,會(huì)在屏幕的兩邊自動(dòng)的出現(xiàn)二個(gè)對(duì)聯(lián)廣告,顯的很醒目。

網(wǎng)站對(duì)聯(lián)廣告對(duì)于做cpa,cps的朋友有很大的好處,我們?cè)谧约鹤鼍W(wǎng)站過程也可以制作出這樣的效果。
dl

制作方法/步驟

  1. 打開自己需要顯示對(duì)聯(lián)廣告的頁面模板,如只想在內(nèi)容頁顯示,選擇 single.php,如果想在網(wǎng)站全部頁面顯示,選擇footer.php;【如果對(duì)wordpress模板不熟悉,可以學(xué)習(xí)一下wordpress模板制作教程】
  2. 在模板文件的底部放上以下的對(duì)聯(lián)廣告的JS特效代碼即可。代碼里的文字和圖片更換成自己的。
    
    
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    var showad = true;
    var Toppx = 60;         //上端位置
    var AdDivW = 100;       //寬度
    var AdDivH = 300;       //高度
    var PageWidth = 800;    //頁面多少寬度象素下正好不出現(xiàn)左右滾動(dòng)條
    var MinScreenW = 1024;  //顯示廣告的最小屏幕寬度象素
    var ClosebuttonHtml = '<div align="right" style="position: absolute;top:0px;right:0px;margin:2px;padding:2px;z-index:2000;"><a href="javascript:;" onclick="hidead()" style="color:red;text-decoration:none;font-size:12px;">關(guān)閉</a></div>'
    var AdContentHtml = '<div align="center" style="color:green;font-size:23pt;font-family:黑體;"> <a href="http://www.lanrentuku.com/" target="_blank"><img src="images/duilian.jpg" width="100" height="300" border="0"></a></div>';
    document.write ('<div id="Javascript.LeftDiv" style="position: absolute;border: 1px solid #336699;background-color:#EEEEE2;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:-1000px;word-break:break-all;display:none;">'+ClosebuttonHtml+'<div>'+AdContentHtml+'</div></div>');
    document.write ('<div id="Javascript.RightDiv" style="position: absolute;border: 1px solid #336699;background-color:#EEEEE2;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:-1000px;word-break:break-all;display:none;">'+ClosebuttonHtml+'<div>'+AdContentHtml+'</div></div>');
    function scall(){
    if(!showad){return;}
    if (window.screen.width<MinScreenW){
    alert("臨時(shí)提示:\n\n顯示器分辨率寬度小于"+MinScreenW+",不顯示廣告");
    showad = false;
    document.getElementById("Javascript.LeftDiv").style.display="none";
    document.getElementById("Javascript.RightDiv").style.display="none";
    return;
    }
    var Borderpx = ((window.screen.width-PageWidth)/2-AdDivW)/2;
    document.getElementById("Javascript.LeftDiv").style.display="";
    document.getElementById("Javascript.LeftDiv").style.top=document.body.scrollTop+Toppx;
    document.getElementById("Javascript.LeftDiv").style.left=document.body.scrollLeft+Borderpx;
    document.getElementById("Javascript.RightDiv").style.display="";
    document.getElementById("Javascript.RightDiv").style.top=document.body.scrollTop+Toppx;
    document.getElementById("Javascript.RightDiv").style.left=document.body.scrollLeft+document.body.clientWidth-document.getElementById("Javascript.RightDiv").offsetWidth-Borderpx;
    }
    function hidead()
    {
    showad = false;
    document.getElementById("Javascript.LeftDiv").style.display="none";
    document.getElementById("Javascript.RightDiv").style.display="none";
    }
    window.onscroll=scall;
    window.onresize=scall;
    window.onload=scall;
    //-->
    </SCRIPT>

通過放上這段JS代碼,就可以在自己做的網(wǎng)站上顯示對(duì)聯(lián)廣告了。如果對(duì)聯(lián)廣告的圖片不顯示,應(yīng)較正代碼中的圖片路徑是否正確。

標(biāo)簽: isp 代碼

版權(quán)申明:本站文章部分自網(wǎng)絡(luò),如有侵權(quán),請(qǐng)聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點(diǎn)!
本站所提供的圖片等素材,版權(quán)歸原作者所有,如需使用,請(qǐng)與原作者聯(lián)系。

上一篇:WordPress與dedecms有什么不一樣

下一篇:MYSQL數(shù)據(jù)庫的數(shù)據(jù)表中字段類型的含義解釋