Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to show content step by step #125

Open
tibaultbordeaux opened this issue Jun 19, 2020 · 1 comment
Open

How to show content step by step #125

tibaultbordeaux opened this issue Jun 19, 2020 · 1 comment

Comments

@tibaultbordeaux
Copy link

Hi all,

I would like to partly hide the content of a slide with a drawn rectangle. The user than should be able to click on this rectangle and reveal the hidden content.

As I'm using h5p with WordPress I created a little WP-Plugin:

<?php
 function h5pmods_alter_scripts(&$scripts, $libraries, $embed_type) {
   $scripts[] = (object) array(
  'path' => '/myh5pmods.js',
  'version' => '?ver=1.0.0' // Cache buster
    );
  }
add_action('h5p_alter_library_scripts', 'h5pmods_alter_scripts', 10, 3);

and the javascript-file myh5pmods.js :

$(".h5p-shape-element.h5p-shape-rectangle").click(function() {
$(this).hide();
});

While the js-file is loading correctly (tested with a simple alert("")) the script is not working.

Who could give some hints for further debugging?

Thanks in advance!

@ceibg
Copy link
Contributor

ceibg commented Jul 2, 2020

This is a subject for a broader functionality suggestion. There should be a way to click on a shape or button and to display hidden content on a slide and vice versa - to hide it. At the moment the only way to simulate this without extra tweaking h5p libraries is to add more slides and to use anchor - click on it and go to slide where the content you like to be seen is present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants