Javascript 使用nAnimate和angular ui在模式中出现转盘问题
我正在更新此问题以更好地适应主题,看起来Angular v1.4.8、Angular Animate 1.4.8和Angular Bootstrap 0.14.3之间存在冲突,在将ngAnimate作为依赖项包含后,这会从模式中断旋转木马的功能。你可以在这里看到 有没有人经历过类似的问题 请参阅附加的屏幕截图。 这是我的main.htmlJavascript 使用nAnimate和angular ui在模式中出现转盘问题,javascript,html,angularjs,angularjs-directive,angular-ui-bootstrap,Javascript,Html,Angularjs,Angularjs Directive,Angular Ui Bootstrap,我正在更新此问题以更好地适应主题,看起来Angular v1.4.8、Angular Animate 1.4.8和Angular Bootstrap 0.14.3之间存在冲突,在将ngAnimate作为依赖项包含后,这会从模式中断旋转木马的功能。你可以在这里看到 有没有人经历过类似的问题 请参阅附加的屏幕截图。 这是我的main.html <div class="col-md-3 col-xs-6" ng-repeat="thumb in thumbs">
<div class="col-md-3 col-xs-6" ng-repeat="thumb in thumbs">
<img ng-src="{{thumb.image}}" alt="{{thumb.name}}" class="img-responsive" ng-click="open($index)" />
</div>
这是我的图库
angular.module('creativestudioApp')
.controller('ModalGalleryCtrl', function ($scope, $uibModalInstance, thumbs) {
$scope.thumbs = thumbs;
console.log('from modal ctrl', $scope.thumbs);
$scope.closeGallery = function () {
$uibModalInstance.dismiss('cancel');
};
});
当链接指令时,似乎不会调用
$destroy
方法,并且幻灯片上的active
属性未设置为false
。从您提供的代码中,我无法理解为什么会发生这种情况,但您可以尝试以明确的方式将false
值设置为active
属性:
$scope.open = function(indx) {
angular.forEach($scope.thumbs, function(e, k) {
$scope.thumbs[k].active = false;
});
//...
当链接指令时,似乎不会调用
$destroy
方法,并且幻灯片上的active
属性未设置为false
。从您提供的代码中,我无法理解为什么会发生这种情况,但您可以尝试以明确的方式将false
值设置为active
属性:
$scope.open = function(indx) {
angular.forEach($scope.thumbs, function(e, k) {
$scope.thumbs[k].active = false;
});
//...
你的
plnkr
链接无效。@LazarevAlexandr我的错,我更新了plnkr。两个插件似乎都能工作,除非我遗漏了什么。你能在不起作用的地方添加一个吗?你确定这不是css问题吗?缺少箭头图像让我怀疑。似乎.carousel inner>.item{display:none}
未应用于元素。您的plnkr
链接无效。@LazarevAlexandr my bad,我更新了plnkr。两个插入器似乎都能工作,除非我缺少什么。你能在不起作用的地方添加一个吗?你确定这不是css问题吗?缺少箭头图像使我对此产生怀疑。似乎.carousel-inner>.item{display:none}
未应用于元素。看起来angular-1.4.8、angular-animate-1.4.8和angular bootstrap 0.14.3之间存在冲突,plunker演示没有将其作为依赖项,但我在本地应用程序中将ng animate作为依赖项。此问题可能不再属于此主题。我会更新劫掠物。非常感谢拉扎雷夫!看起来angular-1.4.8、angular-animate-1.4.8和angular bootstrap 0.14.3之间存在冲突,plunker演示没有将其作为依赖项,但我在本地应用程序中将ng animate作为依赖项。此问题可能不再属于此主题。我会更新劫掠物。非常感谢拉扎雷夫!
$scope.open = function(indx) {
angular.forEach($scope.thumbs, function(e, k) {
$scope.thumbs[k].active = false;
});
//...