Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

https://www.npmjs.com/package/ngx-lightbox

import { Lightbox } from 'ngx-lightbox';

export class AppComponent {
  private _album: Array = [];
  constructor(private _lightbox: Lightbox) {
    for (let i = 1; i <= 4; i++) {
      const src = 'demo/img/image' + i + '.jpg';
      const caption = 'Image ' + i + ' caption here';
      const thumb = 'demo/img/image' + i + '-thumb.jpg';
      const album = {
         src: src,
         caption: caption,
         thumb: thumb
      };

      this._albums.push(album);
    }
  }

  open(index: number): void {
    // open lightbox
    this._lightbox.open(this._albums, index);
  }

  close(): void {
    // close lightbox programmatically
    this._lightbox.close();
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to add,delete,update property in javascript object 
Javascript :: how to take out text from array of strings in react 
Javascript :: discord js ping command 
Javascript :: js test1 
Javascript :: How to extract dynamic variable from < bracket in javascript 
Javascript :: trie node pseudocode 
Javascript :: sessionStorage on DOMContentLoaded javascript 
Javascript :: active state of nav while scrolling 
Javascript :: filtering buttons parseint javascript 
Javascript :: discord.js send dm to specific user 
Javascript :: persian calender for react-native 
Javascript :: installing toast for angular projects 
Javascript :: React sub count 
Javascript :: angular form initialse 
Javascript :: float vape pen instructions 
Javascript :: javascript range setstart 
Javascript :: sqlite get row id after insert nodejs 
Javascript :: clear input field 
Javascript :: Vue Apexchart LineChart 
Javascript :: splice javascript list 
Javascript :: create random salt js 
Javascript :: how to print message in nodjs 
Javascript :: useRef is not working with custom compnents 
Javascript :: javascript to typescript converter tool 
Javascript :: nodejs createwriteStream file image broken 
Javascript :: Ghost-Blog Maria DB Issue 
Javascript :: JavaScript combining rows of multiple datasets 
Javascript :: synchronous file reading 
Javascript :: Using strings, the spread operator creates an array with each char in the string 
Javascript :: tiled spatialmaterial godot 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =