html+css3+jq苹果风格金属开关按钮
发表日期: 2020-07-21 09:17:26 浏览次数:164
杭州网站推广【杭州官网推广哪个效果好】杭州百度竞价推广托管、杭州百度优化推广外包、杭州全网霸屏推广多少钱、杭州网络推广一年大概多少费
杭州,简称“杭”,古称临安、钱塘,是浙江省省会、副省级市、杭州都市圈核心城市,国务院批复确定的中国浙江省省会和全省经济、文化、科教中心、长江三角洲中心城市之一 。截至2019年,全市下辖10个区、2个县、代管1个县级市,总面积16853.57平方千米,常住人口1036万人,城镇人口813.26万人,城镇化率78.5%,常住外来人口达450.44万人。
杭州地处中国华东地区、钱塘江下游、东南沿海、浙江北部、京杭大运河南端,是环杭州湾大湾区核心城市 、沪嘉杭G60科创走廊中心城市、国际重要的电子商务中心 。杭州人文古迹众多,西湖及其周边有大量的自然及人文景观遗迹,具代表性的有西湖文化、良渚文化、丝绸文化、茶文化,以及流传下来的许多故事传说。
杭州自秦朝设县治以来已有2200多年的历史,曾是吴越国和南宋的都城。因风景秀丽,素有“人间天堂”的美誉。杭州得益于京杭运河和通商口岸的便利,以及自身发达的丝绸和粮食产业,历史上曾是重要的商业集散中心。后来依托沪杭铁路等铁路线路的通车以及上海在进出口贸易方面的带动,轻工业发展迅速。新世纪以来,随着阿里巴巴等高科技企业的带动,互联网经济成为杭州新的经济增长点。
html+css3+jq苹果风格金属开关按钮
准备好需要用到的图标。
新建html文档。
书写hmtl代码。
<div id="page">
<form method="get" action="./">
<ul>
<li>
<label for="ch_effects">百度经验百度经验: </label>
<input type="checkbox" id="ch_effects" name="ch_effects" data-on="Show effects" data-off="Hide effects" />
</li>
<li>
<label for="ch_location">百度经验: </label>
<input type="checkbox" id="ch_location" name="ch_location" checked />
</li>
<li>
<label for="ch_showsearch">百度经验: </label>
<input type="checkbox" id="ch_showsearch" name="ch_showsearch" />
</li>
<li>
<label for="ch_emails">百度经验: </label>
<input type="checkbox" id="ch_emails" name="ch_emails" data-on="ON" data-off="OFF" />
</li>
</ul>
</form>
</div>
书写styles.css代码。
* { margin: 0; padding: 0; }
body { background: url('../img/page_bg.png') repeat-x; font: 13px/1.3 'Segoe UI', Arial, sans-serif; color: #999; }
#page { width: 550px; margin: 150px auto 100px; }
form ul { list-style: none; }
form li { padding: 15px; }
form li:nth-child(even) { background: url('../img/line_bg.png') repeat-y center center; }
form label { width: 370px; font-size: 20px; color: #bbb; display: inline-block; }
a, a:visited { text-decoration: none; outline: none; color: #97cae6; }
a:hover { text-decoration: underline; }
#footer { background-color: #212121; position: fixed; width: 100%; height: 70px; bottom: 0; left: 0; z-index: 100000; }
#footer h2 { font-size: 20px; font-weight: normal; left: 50%; margin-left: -400px; padding: 22px 0; position: absolute; width: 400px; color: #eee; }
#footer a.tzine, a.tzine:visited { background: url("../img/tzine.png") no-repeat right top; border: none; text-decoration: none; color: #FCFCFC; font-size: 12px; height: 70px; left: 50%; line-height: 31px; margin: 23px 0 0 110px; position: absolute; top: 0; width: 290px; }
书写jquery.tzCheckbox.css代码。
.tzCheckBox { background: url('background.png') no-repeat right bottom; display: inline-block; min-width: 60px; height: 33px; white-space: nowrap; position: relative; cursor: pointer; margin-left: 14px; }
.tzCheckBox.checked { background-position: top left; margin: 0 14px 0 0; }
.tzCheckBox .tzCBContent { color: white; line-height: 31px; padding-right: 38px; text-align: right; }
.tzCheckBox.checked .tzCBContent { text-align: left; padding: 0 0 0 38px; }
.tzCBPart { background: url('background.png') no-repeat left bottom; width: 14px; position: absolute; top: 0; left: -14px; height: 33px; overflow: hidden; }
.tzCheckBox.checked .tzCBPart { background-position: top right; left: auto; right: -14px; }
<script src="js/jquery.min.js"></script>
<script src="jquery.tzCheckbox/jquery.tzCheckbox.js"></script>
书写jquery.tzCheckbox.js并添加js代码。
(function($){
$.fn.tzCheckbox = function(options){
options = $.extend({
labels : ['ON','OFF']
},options);
return this.each(function(){
var originalCheckBox = $(this),
labels = [];
if(originalCheckBox.data('on')){
labels[0] = originalCheckBox.data('on');
labels[1] = originalCheckBox.data('off');
}
else labels = options.labels;
var checkBox = $('<span>',{
className : 'tzCheckBox '+(this.checked?'checked':''),
html: '<span class="tzCBContent">'+labels[this.checked?0:1]+
'</span><span class="tzCBPart"></span>'
});
checkBox.insertAfter(originalCheckBox.hide());
checkBox.click(function(){
checkBox.toggleClass('checked');
var isChecked = checkBox.hasClass('checked');
originalCheckBox.attr('checked',isChecked);
checkBox.find('.tzCBContent').html(labels[isChecked?0:1]);
});
originalCheckBox.bind('change',function(){
checkBox.click();
});
});
};
})(jQuery);
$(document).ready(function(){
$('input[type=checkbox]').tzCheckbox({labels:['Enable','Disable']});
});
代码整体结构。
查看效果。
近日,立讯精密收购纬创昆山工厂拿下 iPhone 代工一事,引发市场热议。
7 月 17 日,立讯精密发布公告称,立讯精密及控股股东立讯有限拟以 33 亿现金收购江苏纬创昆山纬新的 100% 股权,其中立讯精密在此次收购中出资 6 亿元。完成交易后,立讯精密将成为苹果公司的首家中国内地代工厂商。
从初步的收购方案看,此次收购的标的不并表,对此,中金公司认为,此举能使上市公司财务状况保持在健康水平,避免对上市公司营运表现带来拖累,尤其是并购整合的初期。
对于整个收购事件,申万宏源电子团队则表示,在经历了连接器、模组化时代,立讯成功切入 iPhone EMS,发展动能正迎来第三阶段:从模组走向系统供应商,“小富士康”初见端倪。
杭州网站推广【杭州官网推广哪个效果好】杭州百度竞价推广托管、杭州百度优化推广外包、杭州全网霸屏推广多少钱、杭州网络推广一年大概多少费