列表页模板
<style>@media screen and (max-width: 500px) {
.jnpar_listcon{
width: 95%;
margin: 0.3rem;
border: 1px solid #DDD;
float:left;
}
.price_y{
text-decoration: line-through;
color: #BBB;
margin-left: 0.15rem;
font-size: 0.5rem;
}
.price_n{
color: red;
font-size: 0.7rem;
}
.count_red{
color: red;
font-size: 0.7rem;
}
.span_y{
float: right;
font-size: 0.5rem;
}
.jnpar_listinfo{
padding: 0.5rem;
padding-top:0px;
}
.jnpar_online{
line-height: 1.5rem;
font-family: '微软雅黑';
font-size: 0.7rem;
}
.commidy_title{
display: inline-block;
font-size: 0.7rem;
}
.onlypc{display: none;}
.list_allcon{padding:0.5rem;background:white;}
}
@media screen and (min-width: 501px) {
.jnpar_listcon{
width: 280px;
margin: 6px;
border: 1px solid #DDD;
float:left;
}
.price_y{
text-decoration: line-through;
color: #BBB;
margin-left: 5px;
}
.price_n{
color: red;
font-size: 16px;
}
.count_red{
color: red;
}
.span_y{
float: right;
}
.jnpar_listinfo{
padding: 10px;
padding-top:0px;
}
.jnpar_online{
line-height: 30px;
font-family: '微软雅黑';
font-size: 14px;
border-bottom: 1px solid #EEE;
overflow: hidden;/*超出部分隐藏*/
white-space: nowrap;/*不换行*/
text-overflow:ellipsis;/*超出部分文字以...显示*/
}
.commidy_title{
min-width: 50px;
font-weight: bold;
font-size: 15px;
}
.jnpar_listauthor img{
width: 19px;
border-radius: 50%;
vertical-align: middle;
margin-right: 5px;
}
.list_allcon{padding:10px;}
}
</style>
<div class="list_allcon cl">
<div class="jnpar_listcon">
<div class="main_img">
<a href="{subject_url}" target="_blank"><img src="{cphoto_9_value}" width="100%" height="300px"/></a>
</div>
<div class="jnpar_listinfo">
<div class="jnpar_online"><span class="price_n">{price_n_9_value}金币</span><span class="price_y"></span><span class="span_y">VIP会员免费</span></div>
<div class="jnpar_online"style="padding-bottom:3px;"><a href="{subject_url}" title="{subject}" class="commidy_title">{subject}</a></div>
<div class="jnpar_online onlypc" style="border-top:1px dashed #EEE;padding-top:1px;"><span class="jnpar_listauthor"><img src="{avatar_small}"/></span><a href="{author_url}">{author}</a><span class="span_y"><a href="http://wpa.qq.com/msgrd?v=3&uin=304192058&site=Discuz! Board&menu=yes&from=discuz" target="_blank" title="QQ"><img src="source/plugin/jnpar_sortshop/images/site_qq.jpg" alt="QQ" style="margin-top:3px;"></a></div>
</div>
</div>
</div>
<script src="source/plugin/jnpar_sortshop/js/jquery.min.js" type="text/javascript"></script>
<script>
jq=jQuery.noConflict();
</script>
<script>
jq(document).ready(function() {
jq(".count_red").each(function() {
var sales = (jq(this).text());
if(/^\s*?$/.test(sales)) {
//如果是空的
jq(this).text(0)
} else {
}
});
});
</script>
页:
[1]