jquery使用div块制作的按钮

本文介绍了一个使用jQuery实现的按钮交互效果示例,包括鼠标悬停和点击时的样式变化。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<html>
<head>
    <title>jquery按钮</title>
    <meta http-equiv="content-Type" content="text/html;charset=utf-8" />
    <script src="js/jquery-1.9.1.min.js"></script>
    <style>
        #mystu{
            width: 100px;height: 25px;color: #ffffff;border: 2px outset;border-radius: 5px;text-align: center;
        background-color: silver;font-size: 12px;font-weight: bold;padding: 10px 0px 0px;}
        #stumana{display: inline-block;width: 80px;height: 20px;border: 2px #ffffff;}
    </style>
    <script>
        function showstulist(){
            $("#mystu").css("border","3px inset");
        }
        $(function(){
            $("#mystu").mouseover(function(){
                $(this).attr("class","text-shadow");
                $(this).css("background-color","gray");
                $("#mystu").css("border","3px outset");
            });
            $("#mystu").mouseout(function(){
                $(this).attr("class","");
                $(this).css("background-color","silver");
                $("#mystu").css("border","2px outset");
            });
        });


    </script>
</head>
<body>
    <div id="mystu" οnclick="showstulist()">
        <span id="stumana">jquery按钮</span>
    </div>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值