
jquery
春风又一季
lecodeyang.github.io/yangmimi
展开
-
jquery的一些常用方法
内容追加$("<p></p>").append(text1).append(text2).append(text3); // 追加新元素,这样就是出现三行在p标签里追加内容,添加text123的内容循环遍历$(selector).each(function(index,element)){}$(值的集合).each(function(索引,取代...原创 2019-03-04 15:57:05 · 209 阅读 · 0 评论 -
jquerymobile的动态选择框
$("#btn").click(function() { $("#ch1").prop("checked", !$("#ch1").prop("checked")); $("#ch1").checkboxradio("refresh"); })<button id="btn">改变checkbox&原创 2019-03-15 11:29:46 · 250 阅读 · 0 评论 -
jquery的option的选择取值
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script><script>function sub(){alert($("#aaa").val());}</script></head><body><sele...原创 2019-03-24 19:46:06 · 487 阅读 · 0 评论 -
$.each的循环遍历
$.each()是对数组,json和dom结构等的遍历,说一下他的使用方法吧。1、遍历一维数组 var arr1=['aa','bb','cc','dd']; $.each(arr1,function(i,val){ //两个参数,第一个参数表示遍历的数组的下标,第二个参数表示下标对应的值 console.log(i+'```````'+val);输出的结果为:0```````a...转载 2019-04-13 12:50:55 · 2138 阅读 · 0 评论 -
video的静音,暂停播放
这个有一个bug就是静音的时候,调整音量大小的条还是会有声音,而且静音键没有与音量条结合<!DOCTYPE html><html><head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user...原创 2019-04-19 10:45:32 · 2570 阅读 · 0 评论 -
自定义简单的jquery的插件
color.js//改变背景色的插件 //$.fn.(function($) { /*1.方式一 * * $.fn.changeColor=function(){ if $(this).css("background-color","yellow").css("color","red"); return $(this) }*/ //方式二 $.fn.ex...原创 2019-07-10 11:14:25 · 182 阅读 · 0 评论 -
js数组去重复项插件
js插件mergeArray:function(){ var newArray =[]; for(let i=0;i<arguments.length;i++){ if (arguments[i] instanceof Array) { console.log("参数:" + i + "是数组"); } else { console.log("参数:"...原创 2019-05-31 10:56:32 · 284 阅读 · 0 评论