Recreating accessibility options

  • Neil Pollock
  • Auteur du sujet
  • Hors Ligne
  • Membre premium
  • Membre premium
Plus d'informations
il y a 8 ans 4 mois - il y a 8 ans 4 mois #4996 par Neil Pollock
Recreating accessibility options a été créé par Neil Pollock
I have a learning object where I've used a pseudo element to display a background image. This obviously breaks the colour change accessibility options (Remove Background Images, Invert, Black on Yellow).

I'm trying to figure out if it's possible to recreate these features, or to add some additional rules depending on which option has been clicked.

As a very rough proof of concept I put this together, which essentially does what I need: codepen.io/anon/pen/GxqZMV

However, I can't get this to work in an XOT object - it just doesn't seem to acknowledge any of the clicks to the colour change options in the same way.

Am I missing something obvious here? Is it even possible to change/add to the colour change options in this way?
Dernière édition: il y a 8 ans 4 mois par Neil Pollock.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 8 ans 4 mois #4997 par Fay
Réponse de Fay sur le sujet Recreating accessibility options
Hi Neil

I don't know exactly how you are putting this code in your Xerte project but at a guess I think the colour changer dialog doesn't exist at that point so it can't find the elements to attach your new code to.

The dialog doesn't get created until the colour changer button is clicked for the first time so you need to link your code to this first click. Try something along these lines to set it up:
Code:
var setUp = 0; // this makes sure that the change function is only set up once, even if colour dialog is opened several times $x_colourChangerBtn.click(function() { if (setUp == 0) { setTimeout(function(){ // this just makes sure the dialog contents is ready $('#colourChangerOptions input[type=radio] name=colourChangerRadios]').change(function() { console.log(this.value); // put your code here - value will tell you which radio button is selected }); }, 0); setUp = 1; } });
Les utilisateur(s) suivant ont remercié: Neil Pollock

Connexion ou Créer un compte pour participer à la conversation.

  • Neil Pollock
  • Auteur du sujet
  • Hors Ligne
  • Membre premium
  • Membre premium
Plus d'informations
il y a 8 ans 4 mois #4999 par Neil Pollock
Réponse de Neil Pollock sur le sujet Recreating accessibility options
That makes sense, and a quick test seems to work.

Thanks!

Connexion ou Créer un compte pour participer à la conversation.

Modérateurs: ronmalimcn
Temps de génération de la page : 0.140 secondes
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo