随笔分类 -  javascript学习

摘要:$(".l_val").focus(function(event) { var _val=$(this).attr('data-value'); if ($(this).val()==_val) { $(this).val('').removeClass('l_color'); }; }); $(".l_va... 阅读全文
posted @ 2016-06-13 11:33 Mu薇 阅读(651) 评论(0) 推荐(0)
摘要:$(function () { document.onmousedown = function () { var oBox = document.getElementById("box"); var e = e || window.event; var x = e.clientX; var _left = parseI... 阅读全文
posted @ 2016-06-07 13:55 Mu薇 阅读(156) 评论(0) 推荐(0)
摘要://界面高度自适应 var headHeight=$(".header").height();//头部高度 var mainHeight=$(".mainContent").outerHeight()+40;//内容区域高度 var minHeight=$(window).height()-head 阅读全文
posted @ 2016-03-18 14:29 Mu薇 阅读(182) 评论(0) 推荐(0)
摘要:$(function () { $(".select-default").selectOpen();});$.fn.selectOpen = function () { var singleSelect = function (parentObj) { parentObj.... 阅读全文
posted @ 2015-11-19 14:01 Mu薇 阅读(1204) 评论(0) 推荐(0)
摘要:new Date();Date.prototype.Format = function (fmt) { var arr = { "y+": this.getFullYear(), "m+": this.getMonth() + 1, "d+": thi... 阅读全文
posted @ 2015-11-09 14:41 Mu薇 阅读(267) 评论(0) 推荐(0)
摘要:求数组的最大值function findMax(){ var max=0; for(var i=0;imax){ max=arguments[i]; } } return max; }求和function sun() { var ... 阅读全文
posted @ 2015-11-03 15:06 Mu薇 阅读(320) 评论(0) 推荐(0)
摘要:var app = { //获取字符长度 getLength: function (str) { var length = 0; if ( !! str) { var excStr = str.replace(/[\u4E00-\u9FF... 阅读全文
posted @ 2015-11-03 10:32 Mu薇 阅读(401) 评论(0) 推荐(0)
摘要:来自于http://www.oschina.net/code/snippet_1780998_36843$(".addFullIn").click( function () { $(".questionName").insertContent("( )"); });//$(".... 阅读全文
posted @ 2015-09-06 17:00 Mu薇 阅读(1952) 评论(0) 推荐(0)
摘要:$(document).ready(function () { var radioGroup = $(".radioGroup input"); var types = $(".add-test tr.types"); //全部答... 阅读全文
posted @ 2015-08-13 14:03 Mu薇 阅读(544) 评论(0) 推荐(0)
摘要:var a = [1,2,3,"MU","前端"];var b = "Hello world!"; concat()连接数组↓document.write(a.concat(4,5) + "");//1,2,3,MU,前端,4,5 join()把数组放入一个字符串,参数为连接字符↓documen... 阅读全文
posted @ 2015-07-31 13:17 Mu薇 阅读(306) 评论(1) 推荐(0)