Load H5P shortcodes on button click

Is there a way when a user clicks on one button it will load shortcode number 1 when clicks another button load shortcode number 2. I can do this with iframes but this way I have no integration with my wordpress website.
Can you help me?

falcon's picture

Ideally you would want to load the H5P using ajax, but unfortunately there is no simple API provided by H5P that let you do this easily. The easy way of doing this would probably be to add div tags or other tags with the shortcodes inside them, let them be hidden initially then show the tag that corresponds to the pushed button. You probably also need to trigger window resize to make sure the H5P gets the correct size since it was loaded with no size in the hidden tag. Please let me know if you want more detailed help.

Thanks for your response, I am completely newbie and only know some html tricks. This solution you gave me will handle that I believe.

falcon's picture

Yeah, just post again if you need some more assistance. Getting it to resize might be the hardest part.