Michael Evans
2014-09-14 23:16:39 UTC
Thanks to Dave Gifford's TW5 Mall, I learned about using tm-modal, which
dims and blurs the screen and creates a modal overlay of a designated
tiddler. In layman's terms, it's a built-in lightbox effect.
I tweaked $:/core/modules/utils/dom/modal.js
<#%24%3A%2Fcore%2Fmodules%2Futils%2Fdom%2Fmodal.js> to achieve a look I am
happy with. You can see an example screenshot here:
Loading Image...
By adding the code below to a tiddler, where imgtiddler1 is the name of a
tiddler with an image (or other content) you want displayed modally, you
can achieve this effect.
<$button message="tm-modal" param="imgtiddler1">
[img width="100" [SomeImage.jpg]]
</$button>
This is really great. But this means I have to create a tiddler for every
image I want to lightbox this way.
Is it possible to somehow include a variable placeholder within the tiddler
which will be displayed modally, passing along the source of an image to be
displayed?
I'm not sure really how to do it, but if it's possible it means I can set
up just one image tiddler, instead of dozens.
Thanks,
Michael
dims and blurs the screen and creates a modal overlay of a designated
tiddler. In layman's terms, it's a built-in lightbox effect.
I tweaked $:/core/modules/utils/dom/modal.js
<#%24%3A%2Fcore%2Fmodules%2Futils%2Fdom%2Fmodal.js> to achieve a look I am
happy with. You can see an example screenshot here:
Loading Image...
By adding the code below to a tiddler, where imgtiddler1 is the name of a
tiddler with an image (or other content) you want displayed modally, you
can achieve this effect.
<$button message="tm-modal" param="imgtiddler1">
[img width="100" [SomeImage.jpg]]
</$button>
This is really great. But this means I have to create a tiddler for every
image I want to lightbox this way.
Is it possible to somehow include a variable placeholder within the tiddler
which will be displayed modally, passing along the source of an image to be
displayed?
I'm not sure really how to do it, but if it's possible it means I can set
up just one image tiddler, instead of dozens.
Thanks,
Michael
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.