<!DOCTYPE html><HTML> <HEAD> <meta charset =“utf-8”> <title>我的页面</ title> <! - CSS - > <link rel =“stylesheet”type =“text / css”href =“jquery.fancybox.min.css”> </ HEAD> <BODY> <! - 您的HTML内容到这里 - > <! - JS - > <script src =“// code.jquery.com/jquery-3.2.1.min.js”> </ script> <script src =“jquery.fancybox.min.js”> </ script> </ BODY> </ HTML>
# Bower bower install fancybox --save # NPM npm install @fancyapps/fancybox --save
gulp.task('build-lib-js', ['build-clean-third-lib-js'], function () {
var thirdLibJs = gulp.src([
//外部引用js
'./lib/fancybox/jquery.fancybox.min.js',
])
.pipe(uglify())
.pipe(concat('lib.min.js', {newLine: '\r\n'}))
.pipe(gulp.dest('js'));
return merge.apply(null, thirdLibJs);
});
gulp.task('build-lib-css', ['build-clean-lib-css'], function () {
var thirdLibCss = gulp.src([
//外部引用css
'./lib/fancybox/jquery.fancybox.min.css'
])
.pipe(concat('lib.min.css', {newLine: '\r\n'})) //放在哪个文件中
.pipe(gulp.dest('css'));//打包输出目录(在哪个目录下)
return merge.apply(null, thirdLibCss);
});
<img-box img-url="'xxxxxx.png'" img-style="'width:740px;margin-left:-50px;'"></img-box>
var appModule = angular.module('app.core');
appModule.directive('imgBox',imgBox);
function imgBox() {
return {
restrict:'AE',
transclude:true,
scope:{
imgUrl:"=",
imgStyle:'='
},
template:'<a class="imageBox" href="{{imgUrl}}" rel="external nofollow" rel="external nofollow" rel="external nofollow" data-fancybox><img style="{{imgStyle}}" src="{{imgUrl}}" th:src="${cdn.url('+"'{{imgUrl}}'"+')}" /></a>',
link:function (scope,elem,attrs) {
$(".imageBox").fancybox();
},
}
}
<a href="https://c1.staticflickr.com/9/8387/29155724700_a227577206_k.jpg" data-fancybox="images" data-width="2048" data-height="1365"> <img src="https://c1.staticflickr.com/9/8387/29155724700_58c1cb71cf_m.jpg" /> </a> <a href="https://c1.staticflickr.com/9/8148/29324593462_abebaddc38_k.jpg" data-fancybox="images" data-width="2048" data-height="1366"> <img src="https://c1.staticflickr.com/9/8148/29324593462_f890687b7a_m.jpg" /> </a> <a href="https://c1.staticflickr.com/9/8487/28808645394_a0ff0fc5c1_k.jpg" data-fancybox="images" data-width="2048" data-height="1365"> <img src="https://c1.staticflickr.com/9/8487/28808645394_9c7e6bf8a5_m.jpg" /> </a>
<script type="text/javascript">
$("[data-fancybox]").fancybox({
// Options will go here
});
</script>
template:'<a class="imageBox" href="{{imgUrl}}" rel="external nofollow" rel="external nofollow" rel="external nofollow" data-fancybox><img style="{{imgStyle}}" src="{{imgUrl}}" th:src="${cdn.url('+"'{{imgUrl}}'"+')}" /></a>'
template:'<a class="imageBox" ng-href="{{imgUrl}}" rel="external nofollow" rel="external nofollow" rel="external nofollow" data-fancybox><img style="{{imgStyle}}" ng-src="{{imgUrl}}" th:src="${cdn.url('+"'{{imgUrl}}'"+')}" /></a>'
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有