(代码写得不简洁,但是逻辑就是这样哒)
效果图:
代码直接粘贴的,其实都差不多:
其实在我不会用jquery。js之前,我觉得这个非常难做,但是现在用多了,觉得它非常实用。
$('.footer>a').on('tap',function(){//点击
$(this).children().css('color','#e9af29');//点击的那个变黄色
$(this).siblings().children().css('color','#adaeaa');//同胞的变灰色
var n=$(this).index();//点击的index值
console.log(n+'....');
if(n==0){
// 局部刷新
var home=plus.webview.getWebviewById('tab-home.html');//获取需要刷新的页面
mui.fire(home,'home');//自定义一个函数(获取刷新的页面只要监听home,然后实现想要实现的功能就行)
// alert(home);
}else if(n==1){
var category=plus.webview.getWebviewById('tab-category.html');
mui.fire(category,'category');
// alert(JSON.stringify(category));
}else if(n==3){
var cart=plus.webview.getWebviewById('tab-cart.h

这篇博客介绍了如何使用jQuery实现mui底部导航栏在点击时切换图片和颜色的效果。作者分享了其实现过程,虽然代码可能不够简洁,但通过jQuery的运用,使得这个功能变得相对简单易懂。
最低0.47元/天 解锁文章
1670





