为了账号安全,请及时绑定邮箱和手机立即绑定

jquery搞定换皮肤

标签:
JQuery

<body>

<p>
            <table id="table_1" bgcolor="#8080C0">
               
                <tr>
                    <td><fieldset>
                姓名:<input type="text" name="name" id="name"><p></p>
                电话:<input type="text" name="phone" id="phone"><p></p>
                email:<input type="text" name="mail" id="mail">
               </fieldset> </td>
            <td>
                 <div id="color_1" ></div>
            <div id="color_2" color: rgb(66, 133, 244);" href="file:///C|/Users/Feel~worlD/Desktop/angle/anglebb——2.jpg);width:100px;height:20px">.jpg);width:100px;height:20px"></div>                  //这里放置你的图片
            <div id="color_3" ></div>
            <div id="color_4" ></div>
            </td>
            <td>
           
                <button id="1">金黄色</button><br>     //5个按钮
                <button id="2">人物类</button><br>
                <button id="3">纯黑色</button><br>
                <button id="4">纯绿色</button><br>
                <button id="5">默认色</button><br>
            </td>
            </tr>
            </table></p>

 

<script type="text/javascript" language="javascript">

                      $("#1").click(function(){          //利用jquery的{“#”}获取相应的按钮id
                                
                                $("#table_1").css({         //利用css函数调用背景
                                    
                                    background:"#fFFF00" });   //以下相同
                      
                      }); 

                        $("#2").click(function(){
                               
                                $("#table_1").css({
                                   
                                background:"url(你的图片.jpg)" });
                     
                      });

                         $("#3").click(function(){
                               
                                $("#table_1").css({
                                   
                                    background:"#000000" });
                     
                      });
                     
                     
                       $("#4").click(function(){
                               
                                $("#table_1").css({
                                   
                                    background:"#00CC00" });
                     
                      });


                         $("#5").click(function(){
                               
                                $("#table_1").css({
                                   
                                    background:"#8080C0" });
                     
                      });

</script>


</body>

点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消