jQuery
zhuxufeifei
这个作者很懒,什么都没留下…
展开
-
JQuery ajax实现
//登录 $('#btnlogin').bind('click',function () { $phone = $('#txtPhone').val(); $password = $('#txtPassword').val(); console.log($phone); console.log($password); ...原创 2018-10-23 11:43:15 · 205 阅读 · 2 评论 -
jQuery实现导航栏的样式切换
样式:ul{ margin: 0 auto; height: 50px; background-color: #369;}ul>li{ text-decoration: none; display: inline-block; height: 50px; line-height: 50px; color: #fff; padding: 0 15px; border...原创 2018-11-22 21:59:13 · 1774 阅读 · 0 评论 -
移动端回到顶部 根据距离显示
var h2_height = $(".searchbox").offset().top;//获取一个元素距离顶部距离$(window).scroll(function(){var this_scrollTop = $(this).scrollTop();if(this_scrollTop>h2_height ){$(".gotop").show();}else{$(".goto...原创 2019-01-22 09:47:15 · 643 阅读 · 0 评论 -
选项卡切换
$(’.nav li’).click(function(){$(this).addClass(‘curr’).siblings().removeClass(‘curr’);var i = $(this).index();$(’.filter .container’).eq(i).addClass(‘show’).siblings().removeClass(‘show’);});...原创 2019-01-22 09:48:02 · 172 阅读 · 0 评论 -
移动端 回到顶部按钮特效
html部分<div class="gotop"></div>.gotop{position: fixed;width: 1rem;height: 1rem;z-index: 200;right: .3rem;bottom: 1.5rem;overflow: hidden;}脚本部分 // 回到顶部 $('.gotop').click(function...原创 2019-02-15 13:21:16 · 1838 阅读 · 0 评论 -
自定义滚动条样式
.tabBox .aroundList::-webkit-scrollbar {width: 4px;height: 13px;background: #eee;}.tabBox .aroundList::-webkit-scrollbar-thumb {border-radius: 5px;-webkit-box-shadow: inset 0 0 5px #a0a0a0;background...原创 2019-02-19 18:12:47 · 159 阅读 · 0 评论 -
使用cookie实现首次打开时触发
// 首次点开触发 var res = document.cookie.indexOf("name"); if(res!=0){ var oDate =new Date(); document.cookie ="name=zheng;"; document.getElementById('first').style.displ...原创 2019-04-28 18:02:10 · 431 阅读 · 0 评论