Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using JQuery on buttons in Captivate 2019

Explorer ,
Jul 01, 2020 Jul 01, 2020

Hello, 

Have you ever had issues adding jQurey to a button?   I've added the below script to the slide in the Execute javaScript window on which button, Button_Next is placed. When I preview it, it dose not disable nor turn the button to a .5 opacity.  Any ideas?    Thank you in advance!

 

$("#Button_Next").css({ opacity: "0.5" , "pointer-events", "none"} ); 

327
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 01, 2020 Jul 01, 2020

For what it is worth - Here is how I would do it...

 

First of all - don't forget to add the 'c' after your ID to address the canvas object with your transformations.

 

 

$("#Button_Nextc").css({opacity: "0.5"}); 
cp.disable("Button_Next");

 

 

Another note - you have a comma after pointer-events which should be a colon.

Modifying buttons is always messy work because of how they are crafted in Captivate.

 

When you want to use the button again, just use

 

 

cp.enable("Button_Next");

 

 

Hope this helps.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 01, 2020 Jul 01, 2020

Thank you so very much for your help!!! 
Unfortunately it's still a no go.  I'm using an interactions button which one would think would be fine but maybe a smart shape button or a click box is what only works.  I'll post when I get it to work. Thank you again.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 01, 2020 Jul 01, 2020
LATEST

The code I provided should work for a smartshape button or as an onEnter event.

Not quite sure what you mean by interaction button.

 

Note: if you copy/pasted the code it my have broken as that can change the quotes to ticks which breaks it.

If that is the case - just delete them and retype the quotes.

 

This also assumes the ID given for the button is. Button_Next

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 01, 2020 Jul 01, 2020

One other thought...

 

If you have added this to the onEnter action - you may need to wrap this up in a   setTimeout   in order to see results.

 

setTimeout(function() {
$("#Button_Nextc").css({opacity: "0.5"});
cp.disable("Button_Next");
},250);

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources