Socket
Socket
Sign inDemoInstall

angularjs-lightbox

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    angularjs-lightbox

A minimal lightbox directive for AngularJS.


Version published
Weekly downloads
46
increased by24.32%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

AngularJS Lightbox

npm npm npm

A minimal lightbox directive for AngularJS. No other dependencies!

Check out the demo page!

Installation

This project is available as npm package angularjs-lightbox:

npm install angularjs-lightbox

Include the directive sources (Javascript and CSS) in your AngularJS application:

<script src="https://code.angularjs.org/1.7.8/angular.min.js"></script>

<script src="angularjs-lightbox/src/angular-lightbox.js"></script>
<link type="text/css" rel="stylesheet" href="angularjs-lightbox/src/angular-lightbox.css">

Usage

Declare an array of image URLs, or a single URL:

var app = angular.module('MyApp', ['angular-lightbox']);

app.controller('MyController',  function($scope) {
  $scope.myImages = ['foobar.png', 'foobaz.jpg', 'barbaz.gif'];

  $scope.imageUrl = 'foobar2.png';
});

In your view, use the lightbox attribute on any element, and use the lightbox-trigger class on any child element to trigger the lightbox opening.

Example for a list:

<ul lightbox="myImages">
  <li ng-repeat="image in myImages">
    <a href="image" class="lightbox-trigger">{{ image }}</a>
  </li>
</ul>

Example for a single image:

<span lightbox="imageUrl">
  <a href class="lightbox-trigger">link</a>
</span>

Keyboard shortcuts

  • Left: Previous image
  • Right: Next image
  • Home: First image
  • End: Last image
  • Escap: Close Lightbox

Dependencies

  • Angularjs >= 1.3

Keywords

FAQs

Last updated on 12 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc