javascript - Foundation 5 clearing lightbox not working with angularjs dynamic images -
i'm trying use clearing lightbox component zurb foundation 5 angularjs application haven't found way, example code here:
using code below mess should foundation clearing documentation
<html> <head> <title>todo supply title</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <link href="http://cdn.foundation5.zurb.com/foundation.css" rel="stylesheet"/> </head> <body> <div ng-app="app" ng-controller="clearingcontroller"> <ul class="clearing-thumbs large-12 columns small-block-grid-4" data-clearing> <li ng-repeat="imagen in imagenes"><a href="{{imagen}}"><img ng-src="{{imagen}}"></a></li> </ul> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://cdn.foundation5.zurb.com/foundation.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <script type="text/javascript"> angular.module('app', []) .controller('clearingcontroller', ['$scope', function($scope) { $scope.imagenes = ["http://placehold.it/1000x1000&text=image1", "http://placehold.it/1000x1000&text=image2", "http://placehold.it/1000x1000&text=image3", "http://placehold.it/1000x1000&text=image4", "http://placehold.it/1000x1000&text=image5", "http://placehold.it/1000x1000&text=image6", "http://placehold.it/1000x1000&text=image7", "http://placehold.it/1000x1000&text=image8"]; $(document).foundation(); }]); </script> </body> </html>
do have idea how make work?
while testing threw uncaught referenceerror: modernizr not defined
added http://www.modernizr.com/downloads/modernizr-latest.js, internally used foundation.js
as per documentation $(document).foundation();
should before </body>
, $(document).foundation();
initialize foundation scripts moved out of angular scope.
example : http://codepen.io/anon/pen/enwgqq
Comments
Post a Comment