0 votes
asked by (230 points)

Hi,

With a little search and sense, I managed to get most of what I was trying to do. That is, some of my images may be a little big to display so I wanted to toggle them via a button. I've got that part down pretty good, I think with the help of the search function.

 

.hidden {
  	display:none;
}

<<widget "imagetoggle">><<nobr>>
<<set $dayimage to $args[0]>> <<set $nightimage to $args[1]>>
<<button "Toggle Image">><<toggleclass "#i" "hidden">><</button>>
<div id="i" class="hidden">
<<if $night>>
	<<print '<img src="' + $nightimage + '">'>>
<<else>>
	<<print '<img src="' + $dayimage + '">'>>
<</if>>
</div>
<</nobr>><<endwidget>>

<<imagetoggle img/Home/Room_Day.jpg img/Home/Room_Night.jpg>>

But I'm having trouble doing it in reverse. I was thinking I could have it be an option to have images displayed by default or not. So, if $default ... display: block; ?

A little lost where to go from here.

Please log in or register to answer this question.

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...