Skip to main content
iccolor
Inspiring
July 1, 2020
Question

Using JQuery on buttons in Captivate 2019

  • July 1, 2020
  • 2 replies
  • 388 views

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

    This topic has been closed for replies.

    2 replies

    Stagprime2687219
    Legend
    July 1, 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);

     

    Stagprime2687219
    Legend
    July 1, 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.

    iccolor
    iccolorAuthor
    Inspiring
    July 1, 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.

    Stagprime2687219
    Legend
    July 1, 2020

    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