<div id="London" class="city">
<h2>London</h2>
<p>London is the capital of England.</p>
</div>
<div id="Paris" class="city" style="display:none">
<h2>Paris</h2>
<p>Paris is the capital of France.</p>
</div>
<div id="Tokyo" class="city" style="display:none">
<h2>Tokyo</h2>
<p>Tokyo is the capital of Japan.</p>
</div><div class="w3-bar w3-black">
<button class="w3-bar-item w3-button" onclick="openCity('London')">London</button>
<button class="w3-bar-item w3-button" onclick="openCity('Paris')">Paris</button>
<button class="w3-bar-item w3-button" onclick="openCity('Tokyo')">Tokyo</button>
</div>function openCity(cityName) {
var i;
var x = document.getElementsByClassName("city");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
document.getElementById(cityName).style.display = "block";
}Is there a way to get this function added to the wiki so that the HTML/CSS solution works?.
Thanks in advanceTony--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/8e038951-2cd6-47c5-971c-244a7778e100%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks for that, it will take time for me to fully understand your answer, but I understand why.
Given this is infact a somewhat convoluted method of changing display onclick, can you envision a simple to replace this in tiddlywiki?
I would like to see if I can translate such simple javascript to psuedocode that I can implement in tiddlywiki.
My initial thought is evans formula plugin to change attributes. Somehow I need to trigger an action widget on click and the rest should be easy.
Regards
Tony
Tw buttons instead, action to change a field and formula to give an attribute of display:none to display:block for the selected item.
Wa la
Tony
--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywikidev/a1okj6YIUog/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/174ca05a-f032-40fc-b2f7-cc12ad405f4d%40googlegroups.com.