Recreating accessibility options

  • Neil Pollock
  • Onderwerp Auteur
  • Offline
  • Premium lid
  • Premium lid
Meer
8 jaren 4 maanden geleden - 8 jaren 4 maanden geleden #4996 door Neil Pollock
Recreating accessibility options werd gestart door 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?
Laatst bewerkt 8 jaren 4 maanden geleden door Neil Pollock.

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
8 jaren 4 maanden geleden #4997 door Fay
Beantwoord door Fay in topic 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; } });
De volgende gebruiker (s) zei dank u: Neil Pollock

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • Neil Pollock
  • Onderwerp Auteur
  • Offline
  • Premium lid
  • Premium lid
Meer
8 jaren 4 maanden geleden #4999 door Neil Pollock
Beantwoord door Neil Pollock in topic Recreating accessibility options
That makes sense, and a quick test seems to work.

Thanks!

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Moderators: ronmalimcn
Tijd voor maken pagina: 0.127 seconden
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo