Lightbox sample


How lightbox is running, can you please provide an example:

meteor add lightbox

{{> test}}

<template name="test">
<a href="" class="screenshot"><span class="screenshot-zoom">test</span></a>

Template.test.rendered = function() {

Lightbox is not coming up.


Can you run it from console? i.e: $(".screenshot").lightbox();
P.S. you can use this.$ inside rendered callback: this.$(".screenshot").lightbox();



I am using the following block:

  Template.test.rendered = function() {
    if(!this._rendered) {
      this._rendered = true;
      $(".screenshot").lightbox(); // Tried it as well

and tried this one as well:

  Meteor.startup(function () {
    // code to run on server at startup

meteor list
autopublish 1.0.3 Publish the entire database to all clients
insecure 1.0.3 Allow all database writes by default
jquery 1.11.3_2 Manipulate the DOM using CSS selectors
meteor-platform 1.2.2 Include a standard set of Meteor packages in your app

I get the following when running them:
“TypeError: $(…).lightbox is not a function”

Thanks for the reply.


Can you manually init a lightbox after all DOM has been rendered from BROWSER CONSOLE? $(".screenshot").lightbox();? Is it works? Do you see the lightbox? May be your lightbox plugin doesnt work?