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.

Q: changing text in a div?

Home Forums Puzzles Q: changing text in a div?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33832
    robwu01
    Participant

    Hi all,

    We have a dozen or so objects in a scene, that when clicked on, will popup a modal window that contains a header text, a video and a footer text.

    To keep things manageable, we would like to have just one block of HTML code for the popups, and change the text & video via puzzles for every object clicked.

    We got this working the video source in the iframe, but we’re a bit stuck for getting it working for the header & footer texts.

    All the div’s have appropriate id’s, but we try to figure out how to to this the best way. Is it possible with puzzles like with the iframe?
    Or do we need some form of jscript?
    This is the basic code for the popup:

    
    <div id="video" class="modal_video">
    	<div id="info_all" class="modal">
    		<div id="headervid" class="modal_header"><h5>header_text</h5>
    			<div id="video_close" class="modal_close" >&times;</div>
    		</div>
    			<div id="blockall">
    				<div id="modal_vid" class="iframe_vid">
                    	<iframe id="videolink_var" width="720px" height="405px" src="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
                    </div>
    			</div>
    				<div id="modal_vidtext">
    					<div id="footer_intro" class="modal_p">footer_intro_text</div>
                            <div id="footer_text">
                            <p>paragraph_text</p>
                            </div>
    				</div>
    	</div>
    </div>
    

    Where can we set up/change the html code so the text in header_text, footer_intro_text & paragraph_text is changed based on the object clicked, liked with the video code.

    We’re seem to be stuck atm with the html side of things, and hope someone can point us in the direction of a simple solution for the text changes. :unsure:

    cheers,

    rob

    Below sea level: 52.213545 Lat, 4.422061 Long

    #33853

    Hi,

    you can use the HTML puzzle “set attribute” with innerHTML to replace the contents inside an HTML element.

    Chief 3D Verger | LinkedIn | Twitter

    #33904
    robwu01
    Participant

    Ah… That simple.
    Will test it asap, thanks a lot for the reply :)

    Below sea level: 52.213545 Lat, 4.422061 Long

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