仿iPhone开关式按钮(jQuery+CSS3)

仿iPhone开关式按钮(jQuery+CSS3)

 

001<!DOCTYPE html>
002 <html>
003 <head>
004 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
005 <meta name="author" content="pandao QQ:272383090" />
006 <title>仿iPhone开关式按钮(jQuery+CSS3)</title>
007 <style type="text/css">
008*{margin:0;padding:0;}
009body{font-size:14px;color:#444;font-family:"微软雅黑",Arial;background:#fff;padding:50px;}
010a{color:#444;text-decoration: none;}
011a:hover{color:#065BC2;text-decoration: none;}
012.clear{clear:both;}
013img{border:none;vertical-align: middle;}
014ul{list-style: none;}
015.mwui-switch-btn{
016     width:84px; 
017     display:block;
018     padding:1px;
019     background:#3B75FD;
020     overflow:hidden;
021     margin-bottom:5px;
022     border:1px solid #2E58C1;
023     border-radius:18px;
024     cursor: pointer;
025}
026.mwui-switch-btn span{
027     width:32px;
028     font-size:14px;
029     height:18px;
030     padding:4px 5px 2px 5px;
031     display:block;
032     filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#f6f6f6,endColorstr=#eeeeee,grandientType=1);
033     background:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#eeeeee));
034     background:-moz-linear-gradient(top, #f6f6f6, #eeeeee);
035     border-radius:18px;
036     float:left;
037     color:#3B75FD;
038     text-align:center;
039}
040.mwui-switch-btn:hover span{
041     background:#fff;
042}
043.mwui-switch-btn span.off{float:right;}
044input[type='submit']{padding:5px 10px;cursor: pointer;}
045 </style>
046 </head>
047 <body>
048 <form method="post">
049     显示图标1:<button class="mwui-switch-btn"><span change="开" class="off">关</span><inputtype="hidden" name="show_icon" value="0" /></button>
050     显示顶栏1:<button class="mwui-switch-btn"><span change="关">开</span><input type="hidden" name="open_topbar" value="1" /></button>
051     <br />
052     显示图标2:<button class="mwui-switch-btn"><span change="OFF">ON</span><input type="hidden" name="show_icon2" value="1" /></button>
053     显示顶栏2:<button class="mwui-switch-btn"><span change="ON" class="off">OFF</span><input type="hidden" name="open_topbar2" value="0" /></button>
054     <br />
055     <input type="submit" id="submit" value="提交" />
056 </form>
057 <div id="debuger"></div>
058 <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
059 <script type="text/javascript">
060     $(function() {
061         $('.mwui-switch-btn').each(function() {
062             $(this).bind("click", function() {
063                 var btn = $(this).find("span");
064                 var change = btn.attr("change");
065                 btn.toggleClass('off');
066 
067                 if(btn.attr("class") == 'off') {
068                     $(this).find("input").val("0");
069                     btn.attr("change", btn.html());
070                     btn.html(change);
071                 } else {
072                     $(this).find("input").val("1");
073                     btn.attr("change", btn.html());
074                     btn.html(change);
075                 
076 
077                 return false;
078             });
079         });
080 
081         $("#submit").click(function() {
082             var form = $(this).parent()[0];
083             var inputs = form.getElementsByTagName('input');
084             var params = [];
085             $('#debuger').html('');
086 
087             for (var i=0; i < inputs.length; i++) {
088                 params.push(inputs[i].name+"="+inputs[i].value);
089             }
090 
091             $.post("post.php", params.join("&")+"&temp="+Math.random(), function(data) {
092                 $('#debuger').html(data);
093             });
094 
095             return false;  
096         });
097     });
098</script>
099 </body>
100 </html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
仿iPhone热门应用栏是一个非常流行的产品趋势,许多手机品牌已经开始推出类似的产品。仿iPhone热门应用栏是指手机系统底部的一排常用应用图标,用户可以轻松访问和切换这些应用程序。 优点: 1. 提高用户体验:仿iPhone热门应用栏将常用的应用程序放置在屏幕底部,用户可以轻松地操作和访问这些应用。这种设计提高了用户的便利性和操作效率。 2. 提升工作效率:对于经常使用特定应用程序的用户来说,将它们放在热门应用栏中可以节省寻找和打开应用的时间,提高工作效率。 3. 可定制性:用户可以根据自己的需求和喜好,在热门应用栏中添加或删除特定的应用程序。这种可定制性使得用户可以根据自己的使用习惯进行个性化设置。 缺点: 1. 屏幕空间受限:仿iPhone热门应用栏通常会占据屏幕底部的一部分空间,可能会减少用户在其他应用程序中可见的屏幕空间。这对于一些需要较大屏幕空间才能展示内容的应用程序来说可能是一个问题。 2. 可能存在兼容性问题:由于不同手机品牌和操作系统之间存在差异,仿iPhone热门应用栏可能在某些设备上无法正常运行或显示。这需要开发人员在设计和开发过程中考虑到兼容性问题。 总结: 仿iPhone热门应用栏是一种流行的设计趋势,它提供了一种方便和高效的方来访问和切换常用应用程序。虽然它具有许多优点,但也存在一些限制和挑战,特别是在屏幕空间和设备兼容性方面。因此,在设计和实施仿iPhone热门应用栏时,需要综合考虑这些因素,并根据特定的用户需求进行定制。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值