随笔分类 -  js

摘要:$('#uppic').change(function () { var files = $(this).prop('files'); if (!files.length) { upEnd() return; } upStart(); console.log(files); var data = n 阅读全文
posted @ 2022-12-09 11:17 MasterC 阅读(127) 评论(0) 推荐(0)
摘要:<div class="index_shuzi_bg"> <div class="index_shuzi"> <li> <dt num='2012' id="index_sz1">0</dt> <dd>公司成立于2012年</dd> </li> <li> <dt num='21' id="index 阅读全文
posted @ 2021-08-28 23:20 MasterC 阅读(52) 评论(0) 推荐(0)
摘要:在需要打印的内容上下方加入代码;如下 <!--startprint--> 需要打印的内容。。。。。。 <!--endprint--> 弹窗打印函数 function doPrint(){ var bdhtml=window.document.body.innerHTML; var sprnstr=" 阅读全文
posted @ 2020-11-21 15:42 MasterC 阅读(1356) 评论(0) 推荐(0)
摘要:前端 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>upload</title> <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.j 阅读全文
posted @ 2020-03-12 00:53 MasterC 阅读(639) 评论(0) 推荐(1)
摘要://定义一个记录滚动事件状态的数组 window['my_scroll']=Array; var t; $(window).scroll(function(){ //获取滚动高度,可做触发次数限制 t = document.documentElement.scrollTop||document.body.scrollTop; }) //_class需要操作的div //o通过这个获取触... 阅读全文
posted @ 2019-01-04 16:41 MasterC 阅读(2629) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2017-11-24 19:26 MasterC 阅读(322) 评论(0) 推荐(0)
摘要:php文件内要加上以下代码 php页面输出时按照以下格式 AJAX需要做以下修改 注意红色部分要和上方php返回的参数值相对应 阅读全文
posted @ 2017-07-12 19:49 MasterC 阅读(142) 评论(0) 推荐(0)
摘要:http://echarts.baidu.com/ 官网 插件下载地址:echart 阅读全文
posted @ 2017-06-20 19:29 MasterC 阅读(1893) 评论(0) 推荐(0)
摘要:$(".fix_nav span").click(function(){ //点击事件触发 $(this).addClass("cur").siblings().removeClass("cur"); var Index = $(this).index()+1; ... 阅读全文
posted @ 2017-01-07 14:57 MasterC 阅读(2106) 评论(0) 推荐(0)
摘要:- + ... 阅读全文
posted @ 2016-10-28 11:58 MasterC 阅读(192) 评论(0) 推荐(0)
摘要:body添加 <body onload="showImg()"> 阅读全文
posted @ 2016-10-12 10:16 MasterC 阅读(259) 评论(0) 推荐(0)
摘要:/*{slide:滚动主体 ,li:单个元素: ,img:元素内图片 ,nav: 点击按钮,sudu:速度}*/function slide(arr){var mybody=document.documentElement|| document.body;var mywidth=0;var slid 阅读全文
posted @ 2016-07-06 17:01 MasterC 阅读(259) 评论(0) 推荐(0)
摘要:function stopBubble(e) { //如果提供了事件对象,则这是一个非IE浏览器 if ( e && e.stopPropagation ) //因此它支持W3C的stopPropagation()方法 e.stopPropagation(); else //否则,我们需要使用IE的方式来取消事件冒泡 window.event.can... 阅读全文
posted @ 2016-06-02 11:57 MasterC 阅读(286) 评论(0) 推荐(0)
摘要:<a href="javascript:void(0)" onclick="SetHome(this,window.location)">设为首页</a><a href="javascript:void(0)" onclick="shoucang(document.title,window.loca 阅读全文
posted @ 2016-04-19 16:23 MasterC 阅读(268) 评论(0) 推荐(0)
摘要:图片延时加载 阅读全文
posted @ 2016-03-28 13:55 MasterC 阅读(151) 评论(0) 推荐(0)
摘要:$(function(){ var _index=0; var Time = null; var Sudu=""; for(a=1;a"+a+"") } $("#btn span").eq(0).addClass("cur"); function autoTime(){ if(_index<$("#fl... 阅读全文
posted @ 2016-02-23 12:07 MasterC 阅读(253) 评论(0) 推荐(0)
摘要:var _px = document.getElementById("px"); var con=document.getElementById("content"); px.onclick=function(){ /*定义需要用到的变量*/ var fli=document.getElementB 阅读全文
posted @ 2016-02-16 08:57 MasterC 阅读(169) 评论(0) 推荐(0)
摘要:function uaredirect(f){try{if(document.getElementById("bdmark")!=null){return}var b=false;if(arguments[1]){var e=window.location.host;var a=window.loc... 阅读全文
posted @ 2016-01-15 09:52 MasterC 阅读(675) 评论(0) 推荐(0)
摘要:js提供了parseInt()和parseFloat()两个转换函数。前者把值转换成整数,后者把值转换成浮点数。只有对String类型调用这些方法,这两个函数才能正确运行;对其他类型返回的都是NaN(Not a Number)。四舍五入以下处理结果会四舍五入:varnum =2.446242342;... 阅读全文
posted @ 2016-01-04 13:01 MasterC 阅读(1075) 评论(0) 推荐(0)
摘要:function fx(id){var obj= document.getElementById(id);var fun=function(e){ var w=obj.offsetWidth; var h=obj.offsetHeight; var y=e.clientY; ... 阅读全文
posted @ 2015-12-27 22:16 MasterC 阅读(251) 评论(0) 推荐(0)