Highlighted

Using JQuery on buttons in Captivate 2019

Explorer ,
Jul 01, 2020

Copy link to clipboard

Copied

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"} ); 

Views

48

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Using JQuery on buttons in Captivate 2019

Explorer ,
Jul 01, 2020

Copy link to clipboard

Copied

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"} ); 

Views

49

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 01, 2020 0
Advocate ,
Jul 01, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 01, 2020 0
Explorer ,
Jul 01, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 01, 2020 0
Advocate ,
Jul 01, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 01, 2020 0
Advocate ,
Jul 01, 2020

Copy link to clipboard

Copied

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);

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 01, 2020 0