Hi Anne-Laure, Where in that tiddler do I paste it?
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/2cf65429-c711-485c-9b98-d8bb7dd51a5d%40googlegroups.com.

