init
This commit is contained in:
54
app/index/view/include/catbanner.phtml
Executable file
54
app/index/view/include/catbanner.phtml
Executable file
@@ -0,0 +1,54 @@
|
||||
<!-- 轮播 s -->
|
||||
<?php
|
||||
if (isset($last_cate) && $last_cate)
|
||||
{
|
||||
$banners = getBannerList(5, 1, [['exp', \think\Db::raw('FIND_IN_SET(\'' . $category['pid'] . '\',`categoryid`)')]]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$banners = getBannerList(5, 1, [['exp', \think\Db::raw('FIND_IN_SET(\'' . $category['id'] . '\',`categoryid`)')]]);
|
||||
}
|
||||
|
||||
if (empty($banners)) {
|
||||
$banners = getBannerList(2, 1);
|
||||
}
|
||||
|
||||
if ($banners):
|
||||
?>
|
||||
<div class="homeban homebans_p">
|
||||
<div class="hd">
|
||||
<ul >
|
||||
<?php /*foreach ($banners as $k => $banner): ?>
|
||||
<li id="<?php echo $banner['alt'];?>"><?php echo $k + 1; ?></li>
|
||||
<?php endforeach;*/?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="bd">
|
||||
<ul class="banner_no">
|
||||
<?php foreach ($banners as $banner): ?>
|
||||
<li id="<?php echo $banner['alt'];?>"><a href="<?php echo $banner['url']; ?>"><img src="<?php echo getImage($banner['picture']); ?>"></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
jQuery(".homeban").slide({mainCell: ".bd ul", autoPlay: true, delayTime: 3000});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
jQuery(".homeban").slide(
|
||||
{mainCell: ".bd ul", autoPlay: true, delayTime: 100}
|
||||
|
||||
);
|
||||
$(function(){
|
||||
function aa() {
|
||||
var color = $(".banner_no li").attr('id');
|
||||
|
||||
$(".header-Index #header").removeClass().addClass(color);
|
||||
//console.log(color);
|
||||
}
|
||||
|
||||
window.setInterval(aa,300);
|
||||
})
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
<!-- 轮播 e -->
|
||||
Reference in New Issue
Block a user