Anne-Laure,

Thanks for sharing! I believe this is similar to Tobias Beer's Preview 
plugin:

http://tobibeer.github.io/tw5-plugins/#preview



On Sunday, April 12, 2020 at 5:20:14 PM UTC-5, Anne-Laure Le Cunff wrote:
>
> Hello everyone! I'm super new to TW - just discovered it yesterday. I'm a 
> big fan of Roam Research and was looking for open source alternatives. Many 
> thanks to Dave Gifford and Brandon Hall for their amazing YouTube content 
> which got me curious.
>
> Wanted to share a tiny tip for people building static websites from TW.
>
> Add the following to $:/core/templates/static.tiddler.html (demo 
> <https://twitter.com/anthilemoon/status/1249449244538343428>). This will 
> add an iframe to all your links by targetting *tc-tiddlylink*.
>
> *document.body.innerHTML += '<iframe class="tipdescription" 
> src="http://www.example.com <http://www.example.com>"></iframe>';*
> *var tiptext = document.querySelectorAll('.tc-tiddlylink');*
> *var iframe = document.getElementsByClassName("tipdescription")[0];*
>
> *tiptext.forEach(el => el.addEventListener('mouseover', event => {*
> *   var elem = event.target;*
> *      iframe.style.display = 'block';*
> *      iframe.setAttribute("src", elem.getAttribute("href"));*
> *      elem.appendChild(iframe);*
> *}));*
> *tiptext.forEach(el => el.addEventListener('mouseout', event => {*
> *   var elem = event.target;*
> *    iframe.style.display = 'none';*
> *}));*
>
> --
>
> Just a small way to give back. Very excited to join the community!
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/bf566f80-f7c8-4c5e-9634-0a4a44cbec5d%40googlegroups.com.

Reply via email to