Oh, this is useful.

I want the preview to close after my mouse leave the link, so I made a 
twick.

https://github.com/tobibeer/tw5-preview/issues/1

在 2020年4月13日星期一 UTC+8上午6:58:57,Diego Mesa写道:
>
> 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/5b8a44ef-6dfc-40c2-b0a1-730412714d22%40googlegroups.com.

Reply via email to