随笔分类 -  JavaScript

1995年由Netscape公司的Brendan Eich最初设计的一种直译式脚本语言,是一种动态类型、弱类型、基于原型的语言。
摘要:<button onclick="javascript:history.go(-1);">返回上一页</button> <button onclick="javascript:history.back(-1);">返回上一页</button> 两个方法有所不同,一个保留表单数据,一个不保留数据。 j 阅读全文
posted @ 2016-05-12 17:15 SKILL·NULL 阅读(451) 评论(0) 推荐(0) 编辑
摘要:HTML: <input type="checkbox" onclick="boxOnclick(this,'some1')">全选一 <input type="checkbox" onclick="boxOnclick(this,'some2')">全选二 <input type="checkbo 阅读全文
posted @ 2016-05-11 17:47 SKILL·NULL 阅读(646) 评论(0) 推荐(0) 编辑
摘要:HTML: <button class="addHidden">点击</button> <div class="addShow" style="display:none">隐藏内容</div> JS: $(".addHidden").click(function () { if ($(".addSh 阅读全文
posted @ 2016-05-10 15:40 SKILL·NULL 阅读(760) 评论(0) 推荐(0) 编辑
摘要:HTML: <input type="checkbox" class="all"> <input type="checkbox" name="some"> JS: $(".all").click( function () { if (this.checked) { $("input[name='so 阅读全文
posted @ 2016-05-10 13:53 SKILL·NULL 阅读(187) 评论(0) 推荐(0) 编辑
摘要:HTML: <input type="checkbox" id="check-expert"> <div id="expert" style="display:none">隐藏层</div> JS: $(function () { if ($("#check-expert").attr("check 阅读全文
posted @ 2016-05-06 18:10 SKILL·NULL 阅读(767) 评论(0) 推荐(0) 编辑
摘要:JS获取浏览器宽高的兼容写法: var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;var h = window.innerHeight || document. 阅读全文
posted @ 2016-04-26 17:08 SKILL·NULL 阅读(1047) 评论(0) 推荐(0) 编辑
摘要:HTML: <button type="button" id="showHidden">点击切换div的隐藏与显示</button> <div id="div1">请叫我第一层</div> <div id="div2">请叫我第二层</div> JS: <script type='text/java 阅读全文
posted @ 2016-04-21 11:14 SKILL·NULL 阅读(13099) 评论(1) 推荐(0) 编辑
摘要:HTML: <input type="file" style="display:none" id="addfile-btn"> <div onclick="addfile()">点击上传图片</div> JS: <script> function addfile() { document.getEl 阅读全文
posted @ 2016-04-20 14:29 SKILL·NULL 阅读(2737) 评论(0) 推荐(1) 编辑
摘要:按钮点击显示隐藏层(再次点击按钮则隐藏层关闭): HTML部分: <button type="button" id="show" onclick="showHidden()">点我显示隐藏层</button> <div id="hidden" style="display:none">我是隐藏层。< 阅读全文
posted @ 2016-04-13 19:42 SKILL·NULL 阅读(926) 评论(0) 推荐(0) 编辑
摘要:js部分: <!--自动更新时间--><script>function show(){var date = new Date(); //日期对象var now = "";now = date.getFullYear()+"年"; //读英文就行了now = now + (date.getMonth( 阅读全文
posted @ 2016-01-08 14:26 SKILL·NULL 阅读(2297) 评论(0) 推荐(0) 编辑
摘要:HTML部分: 1.<a onclick="logoClick()"></a> 2.<div id="canvasZone"> <canvas id="myCanvas"></canvas> </div> CSS部分: #canvasZone { width: 100%; height: 100%; 阅读全文
posted @ 2015-12-18 22:05 SKILL·NULL 阅读(981) 评论(0) 推荐(0) 编辑
摘要:CSS部分: #Tab { margin:0 auto; width:640px; border:none; position:absolute; z-index:9; margin-left:320px; _margin-left:0px; padding-top:180px;}.Menubox 阅读全文
posted @ 2015-11-17 10:15 SKILL·NULL 阅读(1149) 评论(0) 推荐(0) 编辑
摘要:JS打造的跟随鼠标移动的酷炫拓图案 阅读全文
posted @ 2015-10-08 10:02 SKILL·NULL 阅读(698) 评论(0) 推荐(0) 编辑
摘要:获取当前阳历日期时间,阴历日期和星期,三者分开,可自行调整顺序。 新建JS文件getdates.js,代码如下: /*获取当前阳历日期*/ function getCurrentDateTime () { var d = new Date(); var year = d.getFullYear(); 阅读全文
posted @ 2015-10-07 14:54 SKILL·NULL 阅读(1039) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示