<script type="text/javascript" charset="utf-8">
mui.init();
mui('.mui-bar-tab').on('tap','a',function(){
//获取id
alert('1111');
});
</script>
是下方的4个菜单:
<nav class="mui-bar mui-bar-tab">
<a class="mui-tab-item mui-active" href="#home">
<span class="mui-icon mui-icon-home"></span>
<span class="mui-tab-label">首页</span>
</a>
<a class="mui-tab-item" href="#faq">
<span class="mui-icon mui-icon-help"></span>
<span class="mui-tab-label">知识库</span>
</a>
<a class="mui-tab-item" href="#location">
<span class="mui-icon mui-icon-location"></span>
<span class="mui-tab-label">附近</span>
</a>
<a class="mui-tab-item" href="#me">
<span class="mui-icon mui-icon-contact"></span>
<span class="mui-tab-label">我</span>
</a>
</nav>
2 个回复
静待枯竭 (作者)
找到问题了。是因为我写在head内,
MUI的ready事件要怎么写呢?
静待枯竭 (作者)
实在惭愧。已解决了。封贴
mui.ready(function(){
mui('.mui-bar-tab').on('tap', 'a', function(e) {
alert('1111');
});
});