1. 将tamahawk的jar包下的org.apache.myfaces.custom.navmenu.htmlnavmenu.resource的内容 拷贝到/css/jscookmenu/
2.定义资源路径
- <t:jscookMenu layout="vbl" theme="ThemePanel" styleLocation="/css/jscookmenu"
- javascriptLocation="/css/jscookmenu" imageLocation="/css/jscookmenu"/>
<t:jscookmenu layout="vbl" theme="ThemePanel" stylelocation="/css/jscookmenu" javascriptlocation="/css/jscookmenu" imagelocation="/css/jscookmenu"></t:jscookmenu>
如果使用了faceslet上面的写法失效,可以如下写法:
<t:jscookmenu layout="vbl" theme="ThemePanel"><t:jscookmenu layout="vbl" theme="ThemePanel">- <t:jscookMenu layout="vbl" theme="ThemePanel" >
- <f:attribute name="org.apache.myfaces.STYLE_LOCATION" value="/css/jscookmenu"/>
- <f:attribute name="org.apache.myfaces.IMAGE_LOCATION" value="/css/jscookmenu"/>
- <f:attribute name="org.apache.myfaces.JAVASCRIPT_LOCATION" value="/css/jscookmenu"/>
- ... ...
- t:jscookMenu>
3. 此时菜单上的图片显示会有问题,修改/css/jscookmenu/ThemePanel/theme.js
var myFolderLeft=myPrefix + 'blank.gif' + mySuffix;
var myFolderRight=myPrefix + 'arrow.gif' + mySuffix;
var myItemLeft=myPrefix + 'blank.gif' + mySuffix;
var myItemRight=myPrefix + 'blank.gif' + mySuffix;
为
var myFolderLeft=myPrefix + '/blank.gif' + mySuffix;
var myFolderRight=myPrefix + '/arrow.gif' + mySuffix;
var myItemLeft=myPrefix + '/blank.gif' + mySuffix;
var myItemRight=myPrefix + '/blank.gif' + mySuffix;
其他主题的修改方法一样
4. 修改theme.css改变菜单样式
搞定!
</t:jscookmenu></t:jscookmenu>