一、my97日历 1、下载插件网址 www.my97.net 2、 注意事项
My97DatePicker目录是一个整体,不可破坏里面的目录结构,也不可对里面的文件改名,可以改目录名 My97DatePicker.htm是必须文件,不可删除(4.8以后不存在此文件) 各目录及文件的用途: WdatePicker.js 配置文件,在调用的地方仅需使用该文件,可多个共存,以xx_WdatePicker.js方式命名 config.js 语言和皮肤配置文件,无需引入(4.8以后合并入WdatePicker.js) calendar.js 日期库主文件,无需引入 My97DatePicker.htm 临时页面文件,不可删除(4.8以后不存在此文件) 目录lang 存放语言文件,你可以根据需要清理或添加语言文件 目录skin 存放皮肤的相关文件,你可以根据需要清理或添加皮肤文件包 当WdatePicker.js里的属性:$wdate=true时,在input里加上class="Wdate"就会在选择框右边出现日期图标,如果您不喜欢这个样式,可以把class="Wdate"去掉,另外也可以通过修改skin目录下的WdatePicker.css文件来修改样式 3、 支持的浏览器
IE 6.0+ , Firefox 2.0+ , Chrome, Opera 9.5+ , Safari 3.0+
注意:IE 8/9/10/11是完美支持的,如果你在IE上使用遇到问题,请与我取得联系,务必附上能再现你的问题的纯HTML代码包
4、引入js文件 <script src="lib/My97DatePicker/WdatePicker.js"></script> 5、创建日历
<div onclick="WdatePicker({el:'myinput',dateFmt:'yyyy-MM-dd'})">sdfsdfsdf</div> <input type="text" onclick="WdatePicker({doubleCalendar:true,dateFmt:'yyyy-MM-dd'})" />6、配置属性
二、懒加载 1、插件下载网址 https://www.w3cways.com/ 2、使用 azy Load 依赖于 jQuery. 请将下列代码加入HTML的结尾,也就是前:
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.lazyload.js"></script>必须改变图片的标签。图像的地址必须放在data-original属性上。给懒加载图像一个特定的class(例如:lazy)同时必须给img 设置宽高。
<img class="lazy" alt="" width="640" height="480" data-original="img/example.jpg" />调用懒加载
在这里插入代码片设置临界点 默认情况下图片会出现在屏幕时加载. 如果你想提前加载图片, 可以设置threshold 选项, 设置 threshold 为 200 令图片在距离屏幕 200 像素时提前加载.
$("img.lazy").lazyload({ threshold : 200 });设置事件来触发加载 你可以使用jQuery事件,例如click和mouseover。也可以使用自定义事件,如sporty、foobar默认情况下是要等到用户向下滚动并且图像出现在视口中时。只有当用户点击它们才加载图片:
$("img.lazy").lazyload({ event : "click" });使用特效 默认情况下,插件等待图像完全加载并调用show()。你可以使用任何你想要的效果。下面的代码使用fadeIn (淡入效果)。
$("img.lazy").lazyload({ effect : "fadeIn" });三、评分插件 下载地址https://github.com/kartik-v/bootstrap-star-rating 搭建环境:
<!--1.引入样式文件--> <!--<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.0/css/bootstrap.css" rel="stylesheet">--> <link rel="stylesheet" href="../itrip-pc/lib/bootstrap/css/bootstrap.min.css" /> <!--2.引入评分插件样式--> <link rel="stylesheet" href="css/star-rating.min.css" /> <!--3.引入jQuery--> <script src="lib/jquery-3.3.1.min.js"></script> <!--4.引入评分插件的js--> <script src="lib/star-rating.min.js"></script>注意:Bootstrap必须是3.0版本以上,引入script文件时,必须先引入jquery文件再引入star-rating.min.js 顺序不能乱。 示例代码:
<div class="container"> <div class="page-header"> <h2>Bootstrap Star Rating Examples <small>© Kartik Visweswaran, Krajee.com</small> </h2> </div> <form> <input id="input-21b" value="4" type="text" class="rating" data-min=0 data-max=5 data-step=0.2 data-size="lg" required title=""> <div class="clearfix"></div> <hr> <input required id="input-21c" value="" type="text" title=""> <div class="clearfix"></div> <hr> <input id="input-21d" value="2" type="text" class="rating" data-min=0 data-max=5 data-step=0.5 data-size="sm" title=""> <hr> <input id="input-21e" value="0" type="text" class="rating" data-min=0 data-max=5 data-step=0.5 data-size="xs" title=""> <hr> <input id="input-21f" value="0" type="text" data-min=0 data-max=5 data-step=0.1 data-size="md" title=""> <hr> <input id="input-2ba" type="text" class="rating" data-min="0" data-max="5" data-step="0.5" data-stars=5 data-symbol="" data-default-caption="{rating} hearts" data-star-captions="{}" title=""> <hr> <input id="input-22" value="0" type="text" class="rating" data-min=0 data-max=5 data-step=0.5 data-rtl=1 data-container-class='text-right' data-glyphicon=0 title=""> <div class="clearfix"></div> <hr> <input required class="rb-rating" type="text" value="" title=""> <hr> <input id="rating-input" type="text" title=""/> <button id="btn-rating-input" type="button" class="btn btn-primary">Toggle Disable</button> <hr> <input id="kartik" class="rating" data-stars="5" data-step="0.1" title=""/> <div class="form-group" style="margin-top:10px"> <button type="submit" class="btn btn-primary">Submit</button> <button type="reset" class="btn btn-default">Reset</button> <button type="button" class="btn btn-danger">Destroy</button> <button type="button" class="btn btn-success">Create</button> </div> </form> <hr> <script> jQuery(document).ready(function () { $("#input-21f").rating({ starCaptions: function (val) { if (val < 3) { return val; } else { return 'high'; } }, starCaptionClasses: function (val) { if (val < 3) { return 'label label-danger'; } else { return 'label label-success'; } }, hoverOnClear: false }); var $inp = $('#rating-input'); $inp.rating({ min: 0, max: 5, step: 1, size: 'lg', showClear: false }); $('#btn-rating-input').on('click', function () { $inp.rating('refresh', { showClear: true, disabled: !$inp.attr('disabled') }); }); $('.btn-danger').on('click', function () { $("#kartik").rating('destroy'); }); $('.btn-success').on('click', function () { $("#kartik").rating('create'); }); $inp.on('rating.change', function () { alert($('#rating-input').val()); }); $('.rb-rating').rating({ 'showCaption': true, 'stars': '3', 'min': '0', 'max': '3', 'step': '1', 'size': 'xs', 'starCaptions': {0: 'status:nix', 1: 'status:wackelt', 2: 'status:geht', 3: 'status:laeuft'} }); $("#input-21c").rating({ min: 0, max: 8, step: 0.5, size: "xl", stars: "8" }); }); </script> </div>在实际做的过程中,可以根据需求在网上拷贝示例代码,再根据具体要求进行修改。