javascript:void(0)
遮罩
filter:alpha(opacity=50); /* IE */
-moz-opacity:0.5; /* Moz + FF */
opacity: 0.5;
面包屑
<YP:catpos catid="$catid" space=" > " />
QQ客户连接
<a href="http://wpa.qq.com/msgrd?v=3&uin=731582594&site=qq&menu=yes" target="_blank">在线咨询</a>
百度地图
<div class="baidu-api">
<iframe src="/APP/Tpl/Home/Default/Public/baiduapi.html" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
</div>
手型
cursor:pointer;
栏目
{$Categorys[20]['catname']}
{$Categorys[20]['url']}
<YP:list order="listorder" catid='27' limit='1'>{$r.url}</YP:list>
当前导航类
{if $bcid==4}current{/if}
友情链接
<YP:link typeid="2" linktype="1" >
<li><a href="{$r['siteurl']}" target="_blank" title="{$r['name']}"><img src="{$r['logo']}" alt="{$r['name']}"></a></li>
</YP:link>
<YP:block pos="about" />
<YP:flash flashid="1" />
{loop}
<li><a href="{$r.link}" target="_blank"><img src="{$r['pic']}" alt="{$r['title']}"></a> </li>
{/loop}
<YP:catpos catid="catid" space=">" />
{$r.title|str_cut=###,15}
<?php $str=strip_tags($r['content']); ?>
内容列表
<YP:list order="id desc" field="*" catid="4" limit="6" posid="1">
<li><a href="{$r.url}" title="{$r.title}">
<img alt="{$r.title}" src="{$r.thumb|thumb=###,219,135,1}" >
</a>
<b><a href="{$r.url}" title="{$r.title}">{$r.title|str_cut=###,15}</a></b>
</li>
</YP:list>
类列表
<YP:subcat catid="8">
<li><a href="{$r.url}">{$r.catname}</a></li>
</YP:subcat>
时间
{$r.createtime|toDate=###,'Y-m-d H:i:s'}
判断
{if $catid==1}
新闻栏目
{elseif $catid==2}
产品栏目
{else}
图片栏目
{/if}
公共模板
<include file="Home:header"/>
第一个伪元素::first-child
第二个伪元素::nth-child(2)
奇数伪元素::nth-child(odd)
偶数伪元素::nth-child(even)
友情链接
<YP:link typeid="2" linktype="2" >
<li><a href="{$r['siteurl']}" target="_blank" title="{$r['name']}"><img src="{$r['logo']}" alt="{$r['name']}"></a></li>
</YP:link>
幻灯片
{loop}
<a href="{$r.link}" target="_blank"><img src="{$r['pic']}" alt="{$r['title']}"></a>
{/loop}
parseInt()
单独设定PNG背景透明
.jcurrent{
background-image: url(../images/yeson.png)!important;/* FF IE7 */
background-repeat: no-repeat;
_filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/yeson.png'); /* IE6 */
_ background-image: none; /* IE6 */
}
.test{
color:#000000; /* FF,OP支持 */
color:#0000FF9; /* 所有IE浏览器(ie6+)支持 ;但是IE8不能识别“*”和“_”的css hack;所以我们可以这样写hack */
[color:#000000;color:#00FF00; /* SF,CH支持 */
*color:#FFFF00; /* IE7支持 */
_color:#FF0000; /* IE6支持 */
}
火狐hack
@-moz-document url-prefix() { .headerR ul li{ margin-left:46px } }
只能输入数字
onkeyup="this.value=this.value.replace(/D/g,'')" onafterpaste="this.value=this.value.replace(/D/g,'')"
鼠标悬浮离开
$(document).ready(function(){
$(".menuli a").mousemove(function(){
x=$(this).parent().find('li').size();
sx=81*x;
$(this).parent().find('ul').css('width',sx);
$(this).next('ul').slideDown("fast");
});
$('.menuli').mouseleave(function(){
$(this).find('ul').slideUp("fast");
});
});
本地URL
<?php echo "http://".$_SERVER['SERVER_NAME'].preg_replace("/admin/main.php/","",$_SERVER['REQUEST_URI']); ?>
单行文本不换行多余文本显示省略号
div{
width:200px;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
多行文本超出隐藏多余文本显示省略号
div{
display:-webkit-box;
overflow:hidden;
text-overflow:ellipsis;
-webkit-line-clamp:3;
-webkit-box-orient:vertical;
}