2014-02-28 110 views
-1

我已经在那里实现了社交网站。朋友状态应根据所选下拉按钮进行更改。我已经添加了我的代码。请提出合适的解决办法下拉选择图标进行更改

<div class="dropdown" id="dLabel"> 
    <button class="btn-small btn-default " data-hover="dropdown" data-target="#" href="#"> 

朋友

  <li><a tabindex="-1" href="#">Close Friends</a></li> 
     <li><a tabindex="-1" href="#">Notification</a></li> 
     <li><a tabindex="-1" href="#">Acquaintances</a></li> 
     <li class="divider"></li> 
     <li><a tabindex="-1" href="#">Add Another List</a></li> 
     <li><a tabindex="-1" href="#">Suggest Friends</a></li> 
     <li class="divider"></li> 
     <li><a tabindex="-1" href="#">Report/Block</a></li> 
     <li><a tabindex="-1" href="#">Unfriend</a></li> 

我glyphicon图标要改变。即我的下拉列表包含上面。通常图标会显示glyphicon-ok图标。如果我选择亲密的朋友,图标将会改变glyphicon-star。如果我选择熟人,另一个图标想要改变。喜欢Facebook的朋友状态。当我们改变密友时。变黄星的图标。像明智的我想要改变,请建议我合适的答案

+1

did not understand that whats your question –

+0

请澄清你想要的东西。也许一步一步列出你想要的东西只需简单的英语。 – Dumisani

回答

0

首先,我明白你的问题,但不能gethow你想达到你的要求。但无论你使用什么,这将是很有用的。 我会建议你使用这样的事情

<select id="dLabel"> 
<option value="CloseFriends">Close Friends</option> 
<option value="Notification">Notification</option> 
//....other options as you used in your code 

</select> 

一个侦听器添加到下拉列表和代码,如果条件相应基础上的。

$('#dLabel').bind('change', function(e,p) { // bind event listener on that component 
var dat=$(this).val(); //get the value of the selected option 

if(val=='CloseFriends'){ 
    //action 
    } 
    //similarly your other conditions 

     });