為axure產生的html網站添加關閉所有節點的功能

來源:互聯網
上載者:User

標籤:style   blog   http   io   ar   color   os   sp   java   

  上一篇隨筆:將Axure用於需求分析工具中,我分享了我做了一個axure組件,方便用axure中製作各種uml圖。

 

  用axure的朋友可能會發現一個問題,如,axure產生的html網站中所有的檔案夾都是預設開啟的,如果檔案太多的話要找到目標檔案是很麻煩的。

 

  

  我要解決這個問題,於是發揮主觀能動性,為這個網站添加“關閉所有節點”的功能。

  找到對應的檔案:安裝目錄\DefaultSettings\Prototype_Files\start.html,給這個檔案加了些js,如下:  

<script type="text/javascript">//關閉所有節點function closeAll(){    var openNode = $(‘#sitemapTreeContainer ul:eq(0)‘).children(‘.sitemapExpandableNode‘);    closeNode(openNode);}//關閉節點function closeNode(node){    node.each(function(i,e){    //尋找子節點        if ($(e).find(‘ul:eq(0)‘).children(‘.sitemapExpandableNode‘).length>0) {        //遞迴             closeNode($(e).find(‘ul:eq(0)‘).children(‘.sitemapExpandableNode‘));        }    //調用單擊事件    $(e).find(‘.sitemapMinus:eq(0)‘).click();    });}$(function(){    //工具列添加“關閉節點”按鈕    $(‘#sitemapToolbar div:eq(0)‘).append(‘<a id="closeNode" onclick="closeAll();" title="關閉節點"> 關閉節點 </a>‘);});</script>

  之後產生的網站效果就是這樣了:

  

  沒加樣式,比較醜陋,有需要的朋友可以繼續改造,哈哈。

為axure產生的html網站添加關閉所有節點的功能

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.