If you want to hide or show the conditionaly element, you should use the Meteor reactive behavior: add the condition to your template:
<template name="gallery"> {{#if isFirstRun}} <div class="main">First run info.... Only on first visit should user see this info.</div> {{/if}} <div id="gallery"> <img src="{{selectedPhoto.url}}"> </div> </template>
then add a helper to your template:
Template.gallery.isFirstRun = function(){
and change the action when pressed:
Template.gallery.events({ 'click .main' : function(){ $(".main").fadeOut(); Session.set("hasRun", true); } })
you can still fade out the element, but instead of hiding it or deleting it, and returning it to the next render , you will make sure that it never returns.
rendering is started by changing the Session variable, which is reactive.
source share