jquery實現可展開收縮的首頁大圖廣告展示方式 泰山壓頂代碼js V2.0

來源:互聯網
上載者:User

標籤:

把代碼做成js網站進行統一調用

if (typeof jQuery == ‘undefined‘) { document.writeln(‘<script type="text/javascript" src="../jquery.js"></script>‘); }else {// jQuery 已載入}//泰山壓頂主要js代碼document.writeln(‘<script type="text/javascript" src="../top.js"></script>‘);    
top.js代碼為:
document.writeln(‘<div class="advbox" style="text-align: center;">‘);document.writeln(‘<div class="dt_small" style="display:none;">‘);document.writeln(‘<div class="dt_toBig" style="display:none;"></div>‘);document.writeln(‘<a href="#" target="_blank"><img src="../images/Small.jpg" width="984" height="130" alt="圖片縮圖" /></a> </div>‘);document.writeln(‘<div class="dt_big">‘);document.writeln(‘<div class="dt_toSmall"></div>‘);document.writeln(‘<a href="#" target="_blank"><img id="actionimg" src="../images/big.jpg" width="986" height="283" alt="圖片大圖" /></a> </div>‘);document.writeln(‘</div>‘);function AdvClick(){    var a=1500;    var b=3*1000;    $(".dt_toSmall").click(function(){        $(".dt_small").delay(a).slideDown(a);        $(".dt_big").stop().slideUp(a);        $(".dt_toSmall").stop().fadeOut(0);        $(".dt_toBig").delay(a*2).fadeIn(0)    });$    (".dt_toBig").click(function(){        $(".dt_big").delay(a).slideDown(a);        $(".dt_small").stop().slideUp(a);        $(".dt_toBig").stop().fadeOut(0);        $(".dt_toSmall").delay(a*2).fadeIn(0)    })}function AdvAuto(){    if($(".dt_big").length>0){        var a=1500;        var b=3*1000;        $(".dt_big").delay(b).slideUp(a,function(){            $(".dt_small").slideDown(a);            $(".dt_toBig").delay(a).fadeIn(0)        });        $(".dt_toSmall").delay(b).fadeOut(0)    }}$(document).ready(function(){    AdvClick();});//頂部通覽可展開收合效果if($("#actionimg").length>0){        $("#actionimg").onload=AdvAuto();}

 

jquery實現可展開收縮的首頁大圖廣告展示方式 泰山壓頂代碼js V2.0

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.