两个页面实现mui轮播图与选项卡结合

Posted 卖女孩的小火柴2号

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了两个页面实现mui轮播图与选项卡结合相关的知识,希望对你有一定的参考价值。

index.html页面

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>

<link href="css/mui.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="css/iconfont.css"/>
<script src="js/mui.min.js"></script>
<script type="text/javascript" charset="utf-8">

</script>
</head>
<style>
.mui-card .mui-control-content {
padding: 10px;
}

.mui-control-content {
height: 150px;
}
</style>
<body>
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">测试</h1>
</header>
<div class="mui-content">
<div style="padding: 10px 10px;">
<div id="segmentedControl" class="mui-segmented-control">

<a class="mui-control-item mui-active" href="#item1">已办公文</a>
<a class="mui-control-item" href="#item2" id="it">全部公文</a>
</div>
</div>
<div>

<div class="mui-slider" id="item1">
<div class="mui-slider-group mui-slider-loop">
<!--支持循环,需要重复图片节点-->
<div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img src="img/3.jpg" /></a></div>
<div class="mui-slider-item"><a href="#"><img src="img/1.jpg" /></a></div>
<div class="mui-slider-item"><a href="#"><img src="img/2.jpg" /></a></div>
<div class="mui-slider-item"><a href="#"><img src="img/3.jpg" /></a></div>
<div class="mui-slider-item"><a href="#"><img src="img/1.jpg" /></a></div>
<!--支持循环,需要重复图片节点-->
<div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img src="1.jpg" /></a></div>
</div>
</div>

</div>
<script type="text/javascript">
mui.init();
var it=document.getElementById(\'it\');
it.addEventListener(\'tap\',function(){
mui.openWindow({url: \'index2.html\', id:\'index2.html\'});
})

</script>

</html>

index2.html页面

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>

<link href="css/mui.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="css/iconfont.css"/>
<script src="js/mui.min.js"></script>
<script type="text/javascript" charset="utf-8">

</script>
</head>
<style>
.mui-card .mui-control-content {
padding: 10px;
}

.mui-control-content {
height: 150px;
}
</style>
<body>
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">测试</h1>
</header>
<div class="mui-content">
<div style="padding: 10px 10px;">
<div id="segmentedControl" class="mui-segmented-control">

<a class="mui-control-item " href="#item1" id="it">已办公文</a>
<a class="mui-control-item mui-active" href="#item2" >全部公文</a>
</div>
</div>
<div>

<div id="item2" class="mui-control-content mui-active">
<div id="scroll" class="mui-scroll-wrapper">
<div class="mui-scroll">
<ul class="mui-table-view">
<li class="mui-table-view-cell">
第一个选项卡子项-1
</li>
<li class="mui-table-view-cell">
第一个选项卡子项-2
</li>
<li class="mui-table-view-cell">
第一个选项卡子项-3
</li>

</ul>
</div>
</div>
</div>

</div>

</div>
<script type="text/javascript">
mui.init();
var it=document.getElementById(\'it\');
it.addEventListener(\'tap\',function(){
mui.openWindow({url: \'index.html\', id:\'index.html\'});
})

</script>

</html>

效果图如下:

 

以上是关于两个页面实现mui轮播图与选项卡结合的主要内容,如果未能解决你的问题,请参考以下文章

微信小程序-轮播图与列表

微信小程序-轮播图与列表

微信小程序-轮播图与列表

简要分析javascript的选项卡和轮播图

原生js实现的3个小特效(时钟轮播图选项卡)

swiper结合ajax的轮播图