2016-07-06 59 views
0

我想改變下拉按鈕的顏色,讓它像「btn btn-primary」一樣。但它也會改變所有菜單項的顏色,並且它也會正確移動它們。 這裏是原來的下拉菜單的樣子: enter image description here如何樣式dropDownButton?

然後我風格是這樣的:

 <xp_1:dropDownButton id="dropDownButton1"> 
      <xp_1:this.treeNodes> 
       <xp_1:basicContainerNode label="Open" 
        styleClass="btn btn-primary"> 
        <xp_1:this.children> 
         <xp_1:basicLeafNode label="item1"> 
         </xp_1:basicLeafNode> 
         <xp_1:basicLeafNode label="item2"> 
         </xp_1:basicLeafNode> 
         <xp_1:basicLeafNode label="item3"> 
         </xp_1:basicLeafNode> 
        </xp_1:this.children> 
       </xp_1:basicContainerNode> 
      </xp_1:this.treeNodes> 
     </xp_1:dropDownButton> 

然後我:

enter image description here

那麼,如何樣式只開放下拉按鈕,但保持默認樣式的菜單項,因此它在按鈕下但不在右側。 我錯了這個樣式,所以我不知道如何添加一個按鈕圖標。

HTML生成:

<html lang="en"> 
<head> 
<title></title> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
<link rel="stylesheet" type="text/css" href="/xsp/.ibmxspres/.mini/css/@B3r&amp;@B3o&amp;@B3m&amp;@B3p&amp;@B3s.css"> 
<script type="text/javascript">var dojoConfig = {locale: 'en-us'};</script> 
<script type="text/javascript" src="/xsp/.ibmxspres/dojoroot-1.9.7/dojo/dojo.js"></script> 
<script type="text/javascript" src="/xsp/.ibmxspres/.mini/dojo/.en-us/@Iq.js"></script> 
<script type="text/javascript">dojo.require("ibm.xsp.widget.layout.xspClientDojo")</script> 
<script type="text/javascript" src="/xsp/.ibmxspres/.extlib/responsive/jquery/jquery.min.js"></script> 
<script type="text/javascript" src="/xsp/.ibmxspres/.extlib/responsive/bootstrap3/js/bootstrap.min.js"></script> 
<script type="text/javascript" src="/xsp/.ibmxspres/.extlib/responsive/xpages/js/xsp-mixin.js"></script> 
</head> 
<body class="xsp dbootstrap bootstrap-theme"> 
<form id="view:_id1" method="post" action="/t_dir/myDb.nsf/TEST.xsp?bpp=1" enctype="multipart/form-data"> 
<div class="btn-group"><div class="btn-group"><button type="button" id="view:_id1:dropDownButton1_ab_0" data-toggle="dropdown" class="btn btn-primary btn btn-default dropdown-toggle">Open <span class="caret"></span></button> 
<ul class="btn btn-primary dropdown-menu"> 
<li class="menu-item"><a>item1</a></li> 
<li class="menu-item"><a>item2</a></li> 
<li class="menu-item"><a>item3</a></li> 
</ul> 
</div> 
</div> 

<input type="hidden" name="$$viewid" id="view:_id1__VUID" value="!710qd094s9ihvkilfn1r22sda!"> 
<input type="hidden" name="$$xspsubmitid"> 
<input type="hidden" name="$$xspexecid"> 
<input type="hidden" name="$$xspsubmitvalue"> 
<input type="hidden" name="$$xspsubmitscroll"> 
<input type="hidden" name="view:_id1" value="view:_id1"></form> 
</body> 
</html> 
+0

顯示生成的html而不是 – dippas

+0

嗯,我將styleClass從「btn btn-primary」更改爲「btn-primary」,以便修復下拉菜單的位置。按鈕是原色。但如何爲菜單本身設置默認顏色? – VladP

回答