標籤: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網站添加關閉所有節點的功能