<?php$this->load->view ( 'header_view' );
?>
<script type="text/javascript">
//喜欢
function share(_item_id){
$.post("
<?=base_url
()?>user_item/like", { item_id:_item_id},
function(data){
if(data.is_like){
$('#like_num'+_item_id).html(data.like_num);
return false;
}else{
alert("已经发表过意见");
}
},"json");
}
function cai(_item_id){
$.post("
<?=base_url
()?>user_item/wuliao", { item_id:_item_id},
function(data){
if(data.is_cai){
$('#wuliao_num'+_item_id).html(data.wuliao_num);
return false;
}else{
alert("已经发表过意见");
}
},"json");
}
$(window).scroll(function(){
var scrollheight = (window.navigator.userAgent.indexOf("Chrome") !== -1)?(document.documentElement.scrollHeight)
document.body.scrollHeight);
if($(this).scrollTop()==0){
$("#box1").css("top","450px");
$("#div_nav").css("position","relative");
}
if($(this).scrollTop()>=300){
$("#box1").css("position","fixed");
$("#box1").css("top","50px");
$("#div_nav").css("position","fixed");
$("#div_nav").css("top","0px");
}
});
</script>
<div id="container">
<!--
<div style="padding-top: 20px;">
<script type="text/javascript">
/*960*90,创建于2013-7-7*/
var cpro_id = "u1315500";
</script>
<script src="http://cpro.baidustatic.com/cpro/ui/c.js" type="text/javascript"></script>
</div>
-->
<div class="main_left">
<ul id="index_ul">
<?
foreach ( $query->result () as $row ) {
?>
<li>
<div class="shentie_title">
<h2>
<a href="
<?php echo base_url
()?>danye?item_id=
<?=$row->id?>">
<?=$row->title?></a>
</h2>
</div>
<div class="shentie_content">
<p></p>
<p>
<a href="
<?php echo base_url
()?>danye?item_id=
<?=$row->id?>"><img
src="
<?=$row->pic_url?>" alt="" /></a>
</p>
</div>
<div class="shentie_footer">
<div class="stf_r">
<a class="x_a_p x_p_hover" id="like
<?=$row->id?>"
> <span class="x_c_p">喜欢(<span
id="like_num
<?=$row->id?>">
<?=$row->like_num?></span>)
</span>
</a> <a class="x_a_p x_p_hover" id="wuliao
<?=$row->id?>"
> <span class="x_c_p">无聊(<span
id="wuliao_num
<?=$row->id?>">
<?=$row->wuliao_num?></span>)
</span>
</a>
</div>
</div>
</li>
<div class="comment" id="comment
<?=$row->id?>">
<div class="comment_head">
<div class="comment_head_1">评论排行</div>
<div class="comment_head_r">
<a
style="cursor: pointer;"><span>收起评论</span></a>
</div>
</div>
<div class="add_comment">
<textarea id="comment_content
<?=$row->id?>" class="comment_content"></textarea>
<a class="comment_content_a">
<span class="comment_content_span">评论</span>
</a>
</div>
<div class="comment_body" id="comment_body
<?=$row->id?>">
<!-- 初始是空白 -->
</div>
<div class="comment_footer">
<div class="comment_footer_r">
<a
style="cursor: pointer;"><span>收起评论</span></a>
</div>
</div>
</div>
<? } ?>
</ul>
<div class="navigation">
<div class='wp-pagenavi'>
<?=$pagebar?>
</div>
</div>
<div style="margin-top: 10px;display: none;">
<script type="text/javascript">
/*728*15,创建于2013-7-5*/
var cpro_id = "u1314739";
</script>
<script src="http://cpro.baidustatic.com/cpro/ui/c.js"
type="text/javascript"></script>
</div>
</div>
<!-- end main left -->
<?php
$this->load->view ( 'sidebar' );
?>
</div>
<!-- end container -->
<div class="clearboth"></div>
<?php
$this->load->view ( 'footer' );
?>
</div>
<!-- end main -->
<script type=text/javascript>
highURL();
function highURL(){
var navId=document.getElementById("nav");
var li_links=navId.getElementsByTagName("a");
for(var i=0; i<li_links.length; i++ ){
var menuLink=li_links
.href;
var currentLink=window.location.href;
if(currentLink.indexOf(menuLink)!=-1&&li_links==currentLink){
li_links.className="current";
}else{
li_links.className="";
}
}
}
function menuFix() {
var sfEls = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls.onmouseover=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls.onMouseDown=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls.onMouseUp=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls.onmouseout=function() {
this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),
"");
}
}
}
window.onload=menuFix;
//--><!]]></script>
</body>
</html>