“跨度按钮”
<span class="spanbutton" title="Span Button!" onclick="spanButtonFunction()">Span Button!</span>
造型:
.spanbutton {
color:#000000;
border:1px solid #000000;
padding-left:8;
padding-right:8px;
border-radius:3px;
cursor:pointer;
font-family: arial;
font-size:small;
/*prevent selection*/
-webkit-user-select:none;
-moz-user-select:none;
/* fallback */
background-color:#EEEEEE;
/* Safari 4-5, Chrome 1-9 */
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#CCCCCC), to(#F4F4F4));
/* Safari 5.1, Chrome 10+ */
background: -webkit-linear-gradient(top, #F4F4F4, #CCCCCC);
/* Firefox 3.6+ */
background: -moz-linear-gradient(top, #F4F4F4, #CCCCCC);
/* IE 10 */
background: -ms-linear-gradient(top, #F4F4F4, #CCCCCC);
/* Opera 11.10+ */
background: -o-linear-gradient(top, #F4F4F4, #CCCCCC);
}
当然还有你的按钮功能脚本。
此外,当您单击按钮时,如果您想对按钮“中单击”的外观进行编码,jQuery 将提供帮助:
$(document).ready(function (){
$(".spanbutton").bind("mousedown", function(e){
buttondown(this);
});
$(".spanbutton").bind("mouseup", function(e){
buttonup(this);
});
$(".spanbutton").bind("mouseout", function(e){
buttonup(this);
});
});
function buttondown(button) {
button.className = "downbutton";
}
function buttonup(button) {
button.className = "spanbutton";
}
还有一些“向下”按钮的样式:
.downbutton {
color:#000000;
border:1px solid #333333;
padding-left:8px;
padding-right:8px;
border-radius:3px;
cursor:pointer;
font-family: arial;
font-size:small;
/*prevent selection*/
-webkit-user-select:none;
-moz-user-select:none;
background-color:#BBBBBB;
}
喜欢就投票吧!这将激励我做更多这样的详细回复