会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
晴天宝宝
博客园
首页
新随笔
联系
管理
订阅
上一页
1
···
9
10
11
12
13
14
15
16
下一页
2019年8月14日
仿微博发布效果
摘要: $(function(){ $(".btn").on("click",function(){ var li=$(""); li.html($(".txt").val()+"删除"); $("ul").prepend(li); $("li").slideDown(); ...
阅读全文
posted @ 2019-08-14 08:55 晴天宝宝i
阅读(292)
评论(0)
推荐(0)
2019年8月13日
jQuery事件处理
摘要: 一、事件处理 on() 绑定事件 on () 方法优势1:可以绑定多个事件,多个处理事件处理程序。 $("div").on({ // 可以绑定多个事件 mouseover: function(){ }, mouseout: function(){ }, click: function(){ } ...
阅读全文
posted @ 2019-08-13 17:33 晴天宝宝i
阅读(142)
评论(0)
推荐(0)
仿电梯导航案例
摘要: JQ: $(function(){ $(window).scroll(function(){ //获取家用电器div距离顶部的高度 var navs=$(".con").children(".d1").offset().top; //判断页面滚动的高度是否不小于,家用电器距离顶部的高度 ...
阅读全文
posted @ 2019-08-13 14:53 晴天宝宝i
阅读(207)
评论(0)
推荐(0)
仿购物车案例
摘要: JQ:$(function(){ //全选改变事件 $(".checkAll").change(function(){ // alert($(this).prop("checked")); $(".checkAll,.check").prop("checked",$(this).pro...
阅读全文
posted @ 2019-08-13 09:11 晴天宝宝i
阅读(179)
评论(0)
推荐(0)
2019年8月12日
案例6:为每一行设置不同的字体颜色
摘要: <script> $(function(){ var arr=["red","skyblue","yellow"]; $("li").each(function(i,dom){ // 遍历 each(function(index,domEle)) $(dom).css("color",arr[i])
阅读全文
posted @ 2019-08-12 14:25 晴天宝宝i
阅读(337)
评论(0)
推荐(0)
2019年8月11日
文本内容值
摘要: <div><span>文本内容</span></div> 1.获取设置元素内容 html( ) $("div").html("123"); // 设置div的元素内容 ("div").html( ); // <span>123</span> 2.获取设置元素文本内容 text( ) $("div")
阅读全文
posted @ 2019-08-11 22:08 晴天宝宝i
阅读(125)
评论(0)
推荐(0)
案例5:全选和反选
摘要: <script> $(function(){ // 方式一: $("#allCheck").change(function(){ if($(this).prop("checked")==true){ $(".check").each(function(){ $(this).prop("checked
阅读全文
posted @ 2019-08-11 21:15 晴天宝宝i
阅读(154)
评论(0)
推荐(0)
案例4:突出显示案例
摘要: <style> body{margin: 0;padding: 0;background: #000;} a{display: inline-block;} img{height:150px;width: 150px;} ul{width: 480px;} ul li{list-style: non
阅读全文
posted @ 2019-08-11 15:51 晴天宝宝i
阅读(189)
评论(0)
推荐(0)
2019年8月10日
案例3:事件切换及动画队列停止排队效果
摘要: //鼠标移入事件 $(".nav > li").mouseover(function(){ $(this).children("ul").slideUp(200); }) //鼠标离开事件 $(".nav > li").mouseout(function(){ $(this).children("u
阅读全文
posted @ 2019-08-10 23:16 晴天宝宝i
阅读(250)
评论(0)
推荐(0)
案例2:tab栏切换
摘要: <style> body,ul,li,div{margin:0;padding: 0;} ul{font-size: 0px;} .tab_list{ border: 1px gray solid; width: 400px;height: 50px; background: gainsboro;
阅读全文
posted @ 2019-08-10 20:30 晴天宝宝i
阅读(253)
评论(0)
推荐(0)
上一页
1
···
9
10
11
12
13
14
15
16
下一页
公告