辉
  • 发布:2015-10-30 12:05
  • 更新:2015-10-30 15:53
  • 阅读:9016

怎样获取mui里面所选择的值

分类:MUI
js

怎样获取mui里面我所选择的值?如我传的图片上的格式。
我写的js代码:
$("#dzq").empty();
$(cityList).each(function(){
var li='<ul class="mui-table-view mui-table-view-xradio ">'
+'<li class="mui-table-view-cell mui-ellipsis ">'
+'<a class="mui-navigate-right">'
+this
+'</a>'
+'</li>'
+'</ul>';

 $("#dzq").append(li);      
});  

网页里的代码:
<div id="segmentedControlContents" class="mui-col-xs-7" >
<div class="mui-control-content mui-active" >
<div class="mui-control-content mui-active" id="dzq">
<ul class="mui-table-view mui-table-view-xradio" >
<li class="mui-table-view-cell">
<a class="mui-navigate-right" id="contentx1">
东城区
</a>
</li>
</div>
</div>
</div>
<script>
function juzhuShow(){
var elem=document.querySelector('.mui-table-view-radio .mui-selected');
var segmentedControlContents=document.getElementById("segmentedControlContents");
var muiControlContent=jQuery('.mui-control-content');
segmentedControlContents.style.height=window.innerHeight-44+"px";
//muiControlContent.get(0).style.height=window.innerHeight-44+"px";
muiControlContent.css('height',jQuery(window).height());
var editJuzhu=mui('#editJuzhu')[0];
mui('.jianli-juzhu')[0].addEventListener('tap',function(){
editJuzhu.className="mui-modal mui-active";
});
mui('.mui-scroll-wrapper').scroll();//设置滚动
mui('.juzhuOK')[0].addEventListener('tap',function(){
editJuzhu.className="mui-modal";
//mui('.juzhuNameCon')[0].innerHTML=mui('.mui-selected')[0].children[0].innerHTML;
});

                    jQuery('#segmentedControlContents li').on('click',function(){  
                    jQuery('#segmentedControlContents li').removeClass('mui-selected');  
                    jQuery(this).addClass('mui-selected');  
                    })  
                }  

</script>

2015-10-30 12:05 负责人:无 分享
已邀请:
辉

(作者)

加在js页面里面:
mui('.jianli-juzhu')[0].addEventListener('tap',function(){
editJuzhu.className="mui-modal mui-active";
});
mui('.mui-scroll-wrapper').scroll();//设置滚动
mui('.juzhuOK')[0].addEventListener('tap',function(){
editJuzhu.className="mui-modal";
mui('.juzhuNameCon')[0].innerHTML=mui('.mui-selected')[0].children[0].innerHTML;
});

jQuery('#dzq li').on('click',function(){  
jQuery('#dzq li').removeClass('mui-selected');  
jQuery(this).addClass('mui-selected');  
})

该问题目前已经被锁定, 无法添加新回复