- This topic has 6 replies, 2 voices, and was last updated 2 years, 2 months ago by Mariusz.
-
AuthorPosts
-
2022-10-17 at 1:12 pm #56657MariuszCustomer
In my configurator, the user can choose the country from a dropdown menu that was added via HTML puzzles – this function changes the texture on the flag. It all works fine. The parameter is saved in a link, so after reloading the page, the user can see the flag that he previously chose. But, the dropdown menu displays the “Default” option instead of a chosen country. I think I should somehow add “selected” to the “option” in HTML, to tell the code which dropdown menu should be displayed. But I don’t know how to do it with puzzles.
In the attachment, I am adding my HTML configuration and a puzzle setup where I try to use the “replace text” puzzle to add this “selected” word. But it doesn’t work. Any ideas on how this could be done? Thank you!
Attachments:
You must be logged in to view attached files.2022-10-17 at 2:20 pm #56660kdvParticipantYou can use this puzzle to set the default value for a selector.
Btw, your
replace with
puzzles do nothing usefull. To make it work you should set a newinnerHTML
property using the result of thereplace with
puzzle.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2022-10-18 at 7:38 am #56665MariuszCustomerOh my… “Set prop” puzzle. Of course! That was so obvious. thank you! It works now.
2022-10-18 at 8:05 am #56666kdvParticipantYou’d better use this simple universal puzzle set instead of multiple
else if
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2022-10-18 at 9:49 am #56670MariuszCustomerThat’s clever, thank you! By the way, do those two different techniques impact the application’s performance anyhow? Besides lagging in the Verge3D puzzle viewport, of course.
I mean, is there any difference in the app performance depending on whether I will use “else if” + “replace texture” 20 times, or whether I will use the universal puzzle configuration like above?
When I started this project, I had no idea on how to create universal puzzles using a combination of text-replacing puzzles. So now, I have a loooooot of repetitive puzzle setups for different configurator options. I wonder if changing them all to universals is worth my time spent on this project since it’s a lot of work to do.
2022-10-18 at 9:57 am #56671kdvParticipantNope, perfomance is not degraded, maybe slightly. It’s just the matter of code optimization and
lagging in the Verge3D puzzle
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2022-10-19 at 3:46 pm #56701MariuszCustomerOk, good to know. Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.