We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

How make text from div in separate HTML file display in specific screen position

Home Forums Puzzles How make text from div in separate HTML file display in specific screen position

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #35331
    jaspixel
    Customer

    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 :wacko: .

    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.

    :unsure:

    Many thanks,

    Jas

    #35368

    Hi,

    you can first load the html file using the load data puzzle
    https://www.soft8soft.com/docs/manual/en/puzzles/Advanced.html#load_data

    Then 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)

    Chief 3D Verger | LinkedIn | Twitter

    #35372
    jaspixel
    Customer

    Hi 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
    :good:

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.