摘要: oninput方法是元素获取用户输入时触发。 onchange该事件在表单元素的内容改变时触发( <input>, <keygen>, <select>, 和 <textarea>) 阅读全文
posted @ 2022-05-30 10:21 吃惊夜夜 阅读(134) 评论(0) 推荐(0) 编辑
摘要: /** * 统计区分中英文字符字数 */function getWordsCnt(str){ var n = 0; for(var i=0;i<str.length;i++){ var ch = str.charCodeAt(i); if(ch > 255){ // 中文字符集 n+=2; }els 阅读全文
posted @ 2022-05-25 14:28 吃惊夜夜 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 这个问题应该是因为用了左右浮动,苹果11以上清除浮动没生效。数据顶上去了。。。 阅读全文
posted @ 2022-05-17 13:39 吃惊夜夜 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 1. 强制不换行div{ white-space:nowrap;}2. 自动换行div{ word-wrap: break-word; word-break: normal;}3. 强制英文单词断行 div{ word-break:break-all; } 阅读全文
posted @ 2022-05-05 14:00 吃惊夜夜 阅读(609) 评论(0) 推荐(0) 编辑
摘要: 引入swiper组件库点击第一个或者最后一个居中左右留白的问题。 var mySwiper = new Swiper('.swiper-container2', { slideToClickedSlide: true, //开启点谁谁居中 centeredSlides: true, // 居中 sl 阅读全文
posted @ 2022-04-29 10:38 吃惊夜夜 阅读(325) 评论(0) 推荐(0) 编辑
摘要: 一、阻止事件冒泡 $().onclick = function(event) { // return false; 1.第一种方法 event.stopPropagation(); 2.第二种方法 通过event对象的方法 } 二、阻止默认行为 $().onclick = function(even 阅读全文
posted @ 2022-04-24 23:57 吃惊夜夜 阅读(167) 评论(0) 推荐(0) 编辑
摘要: var play; if(!play){ //大小图轮播 var sWidth = $(".briefing .briefingLive").width(); var lens = $(".liveBigImg li").length; var indexs = 0; var liLens = (1 阅读全文
posted @ 2022-04-21 18:54 吃惊夜夜 阅读(18) 评论(0) 推荐(0) 编辑
摘要: $(document).ready(function(){ scroll_f(".luck-tip .scroll-box",300); }); //滚动 var scrollIndex = 0; var Timer = null; function scroll_f(obj,time){ clea 阅读全文
posted @ 2022-03-31 14:46 吃惊夜夜 阅读(41) 评论(0) 推荐(0) 编辑
摘要: display:list-item这个在工作中几乎没有用过。刚刚遇到了,了解了一下它的用法,记录在这里。 “display:list-item : 为元素内容生成一个块型盒,随后再生成一个列表型的行内盒。” 例子如下: 为一个段落p定义如下样式:display:list-item;list-styl 阅读全文
posted @ 2022-03-22 10:26 吃惊夜夜 阅读(379) 评论(0) 推荐(0) 编辑
摘要: $(".scrollMenuItem a").each(function() { var _this = $(this); if (window.location.href.indexOf(_this.attr('href')) > -1) { _this.addClass("active").si 阅读全文
posted @ 2022-02-25 10:41 吃惊夜夜 阅读(34) 评论(0) 推荐(0) 编辑