在我的视图页面中,我使用网格视图和列表视图,我希望网页视图在页面加载时处于活动状态。
我面临的问题是浏览器加载页面时,在点击标签菜单之前没有显示任何数据。
这是我的观点页面..
<li id="grid" class="<?php if($this->session->userdata('view')==='grid'){?>active<?php }?>"><a href="#shop-grid-tab" data-toggle="tab" onclick="Javascript: grid_active('grid')"><i class="fa fa-th"></i></a></li>
<li id="list" class="<?php if($this->session->userdata('view')==='list'){?>active<?php }?>"><a href="#shop-list-tab" data-toggle="tab" onclick="javascript: grid_active('list')"><i class="fa fa-th-list"></i></a></li>
<--grid view-->
<div class="tab-pane fade in <?php if($this->session->userdata('view')==='grid'){?>active<?php }?>" id="shop-grid-tab">
<div class="row ">
<?php foreach($mengalery as $row){?>
<?php $images=json_decode($row->image);{?>
<a href="#" target=""><img class="slb" src="<?php echo base_url();?>images/<?php echo $images[0];?>" style="width: 500px; height: 300px; " alt="" /></a>
<?php}}?>
</div>
</div>
<--list view-->
<div class="tab-pane fade in <?php if($this->session->userdata('view')==='list'){?>active<?php }?>" id="shop-list-tab">
<div class="list-view container3">
<?php foreach($mengalery as $row){?>
<?php $images=json_decode($row->image);{?>
<div class="product_blog_image"> <a href="#"><img src="<?php echo base_url();?>images/<?php echo $images[0];?>" alt="" class="slb" style="width: 500px; height: 300px; " /></a> </div>
</div>
</div>