摘要: 效果 官网下载 https://fancyapps.com/fancybox 大概就是这么一个效果。 使用 下载好 fancybox.umd.js和fancybox.css 使用以下js代码: $("img").each(function () { var element = document.cr 阅读全文
posted @ 2022-08-28 21:02 蚂蚁追风筝 阅读(103) 评论(0) 推荐(0)
摘要: 代码 /粘性导航 var basic = 80; $(window).scroll(function () { var top = $(window).scrollTop(); if (top > basic) { $('header').removeClass("header_fixed"); } 阅读全文
posted @ 2022-08-28 20:51 蚂蚁追风筝 阅读(26) 评论(0) 推荐(0)
摘要: 效果 输入内容的同时,字数会相应同步改变 实现方式 使用jQuery实现的,比较简单。 $('#').bind('input propertychange', function () { $('#').text(); }); 使用bind给DOM对象同时绑定input和propertychange两 阅读全文
posted @ 2022-08-28 20:41 蚂蚁追风筝 阅读(115) 评论(0) 推荐(0)
摘要: js代码 $.fn.autoHeight = function () { function autoHeight(elem) { elem.style.height = 'auto'; elem.scrollTop = 0; //防抖动 elem.style.height = elem.scroll 阅读全文
posted @ 2022-08-28 20:28 蚂蚁追风筝 阅读(81) 评论(0) 推荐(0)