fancybox指令未对图像进行分组
fancybox directive not grouping images
我已经为花式盒子创建了指令。它在花式框中打开图像,而不是对图像进行分组。我在Fancybox指令中检查了另一个解决方案,ng repeat不是对图像进行分组,但它们不会解决我的问题。
HTML:
<a fancybox class="fancybox" rel="group" data-thumbnail="http://fancyapps.com/fancybox/demo/2_s.jpg" href="{[{i.location}]}" title="{[{i.name}]}" width="460" height="298">
## Image ###<img src="{[{i.location}]}" alt="" width="460" height="298" />
</a>
JS花式盒子指令::
App.directive('fancybox',function($compile, $timeout){
return {
link: function($scope, element, attrs) {
alert('i am called');
element.fancybox({
openEffect : 'none',
closeEffect : 'none',
padding : 40,
margin : [20, 60, 20, 60] ,// Increase left/right margin
helpers: {
thumbs: {
width : 40,
height : 40,
source : function(current) {
return $(current.element).data('thumbnail');
}
}
},
});
}
};
});
我无法用fancybox实现它。无论如何,我改用引导转盘,引导更容易使用,
<div ng-controller="CarouselDemoCtrl">
<div style="height: 305px">
<carousel interval="myInterval">
<slide ng-repeat="slide in slides" active="slide.active">
<img ng-src="{{slide.image}}" style="margin:auto;">
<div class="carousel-caption">
<h4>Slide {{$index}}</h4>
<p>{{slide.text}}</p>
</div>
</slide>
</carousel>
</div>
<div class="row">
<div class="col-md-6">
<button type="button" class="btn btn-info" ng-click="addSlide()">Add Slide</button>
</div>
<div class="col-md-6">
Interval, in milliseconds: <input type="number" class="form-control" ng-model="myInterval">
<br />Enter a negative number or 0 to stop the interval.
</div>
</div>
</div>
带角度的引导式旋转木马
我们可以在bootstrap提供的Carousel中进行大量定制。
相关文章:
- 在指令内加载后访问子元素图像
- ng-repeat图像上的指令仅提取有关第一个图像的信息
- 图像追加不适用于 ng 重复中的指令
- 如何制作 AngularJS 指令来更改图像的 src 属性
- AngularJS图像上传预览没有指令
- 用于图像预览的角度指令
- fancybox指令未对图像进行分组
- 一个指令,在图像完全渲染后返回一个promise
- 更新ng repeat using指令创建的图像
- Angular指令:重新缩放图像,在ngSrc更改时更新
- Angular指令创建画布并下载为图像
- AngularJS -图像onload指令- this'参考不起作用
- Chrome加载图像时拖动,即使在angular指令中的preventDefault()
- AngularJS-使用指令显示图像
- 如何验证超过upload_max_filesize指令的图像的最大大小
- AngularJS加载图像指令setTimeout问题
- 自定义指令隔离多个图像转盘的作用域
- 用于偶然背景图像的角指令
- Angular在点击指令时淡出图像
- 创建指令时不显示背景图像