Home › Forums › Puzzles › How make text from div in separate HTML file display in specific screen position
- This topic has 2 replies, 2 voices, and was last updated 4 years, 1 month ago by jaspixel.
-
AuthorPosts
-
2020-11-14 at 7:55 pm #35331jaspixelCustomer
Hi,
Apologies, but I have trawled the tutorials and not found a specific guide for this one. For us non coding/html/java savvy folks, this kind of thing isn’t so obvious when starting out unfortunately.
If anyone could point me to showing the puzzle combination to do this I would be very grateful. Teapot and Robot have similar elements to what I need, I’m just too dim to relate them to my project sadly.
Basically, I have a short piece of text (basic viewing instructions for user in one sentence) within a div in another html file called overlay.html. The text div has a class name and id also named “overlay” to keep it simple like me .
I am trying to use the HTML puzzles to call this text within the div and show it in the centre of the screen during specific points in time. Presumably I need to use a simple html get div/id puzzle and then display it in a specific position with styling. I just cant seem to make any puzzle combo work :/
Is there a screen shot somewhere showing the puzzle combination I should use please with an explanation of what each puzzle entry corresponds to ideally?
I don’t want to assign to an annotation, because as I understand, that would be fixed in a 3d space and not independent for just screen display on top as an overlay.
Many thanks,
Jas
2020-11-16 at 12:23 pm #35368Yuri KovelenovStaffHi,
you can first load the html file using the load data puzzle
https://www.soft8soft.com/docs/manual/en/puzzles/Advanced.html#load_dataThen you create a new HTML element (a DIV)
https://www.soft8soft.com/docs/manual/en/puzzles/HTML.html#add_HTML_element
…and position it using the set style puzzle
https://www.soft8soft.com/docs/manual/en/puzzles/HTML.html#set_style
Finally, you can inject the contents of the loaded html file into this DIV using this puzzle
https://www.soft8soft.com/docs/manual/en/puzzles/HTML.html#set_attribute
(select innerHTML in the dropdown)2020-11-16 at 12:53 pm #35372jaspixelCustomerHi Yuri,
Ok great thanks, I’ll give it a go.
Was thinking of just setting visibility:hidden in CSS for the divs, then trying to show them with puzzles as is effectively what I did with my menu to stop it showing during the preloader.
I’ll check your method though as offers more control I imagine, many thanks.
Jas
-
AuthorPosts
- You must be logged in to reply to this topic.