首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

jQuery制造动态渐变按钮

2013-12-07 
jQuery打造动态渐变按钮演示地址:http://www.corange.cn/demo/3665/!DOCTYPE html PUBLIC -//W3C//DTD X

jQuery打造动态渐变按钮


演示地址:http://www.corange.cn/demo/3665/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>jOuery:动态渐变按钮演示--by维奇</title>
<link rel="stylesheet" href="style.css" /><!-- 页面样式 -->
<style>

/* 纯CSS按钮 */
.button {
width:200px;
height:80px;
display:block;
background:url(bg_button.gif) top no-repeat;
text-indent:-9999px;
}
.button:hover{
background:url(bg_button.gif) bottom no-repeat;
}

/* jQuery动态渐变按钮 */
.jsbutton {
position:relative;
display:block;
width:200px;
height:80px;
background:url(bg_button.gif) top no-repeat;
cursor: pointer;
text-indent:-9999px;
}?
.jsbutton span.hover {
position: absolute;
display: block;
width:200px;
height:80px;
background:url(bg_button.gif) bottom no-repeat;
text-indent:-9999px;
}


/* 扩展应用按钮样式 */
.viewbutton,.viewbutton span.hover,.downloadbutton,.downloadbutton span.hover{
display: block;
width:120px;
height:42px;
background-image:url(vd_bg_button.gif);
text-indent:-9999px;
}
.viewbutton {
float: left;
position:relative;
background-position: top left;
}
.viewbutton span.hover{
position: absolute;
background-position: bottom left;
}
.downloadbutton {
float: left;
position:relative;
background-position: top right;
}
.downloadbutton span.hover{
position: absolute;?
background-position: bottom right;

}

</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.jsbutton,.viewbutton,.downloadbutton').wrapInner('<span class="BSHARE_COUNT bshare-share-count">0


原文地址:http://www.corange.cn/archives/2010/07/3665.html

热点排行