Skip to main content
avid_body16B8
Legend
July 27, 2018
Answered

Is it possible to add and remove class names in ANCC canvas

  • July 27, 2018
  • 2 replies
  • 594 views

Is it possible to add and remove class names to symbols' instances since we are using JavaScript and Jquery?

I am thinking of senari where I need tracking questions done or not done, etc... Sometimes I accomplish that with variables but sometimes I prefer a class.

    This topic has been closed for replies.
    Correct answer kglad

    you should be able to add a className:

    this.mc.className='correct_class';

    because of timing issues (you'll need to add jquery before using addClass() ) i'm not sure addClass() will work that way you want.

    2 replies

    Legend
    July 27, 2018

    If you're talking about the HTML DOM attribute class (intended for CSS formatting and element selection), that only exists on HTML DOM objects. It does not exist on canvas stage objects. The only DOM objects Animate creates automatically are the jQuery UI widgets.

    avid_body16B8
    Legend
    July 27, 2018

    Interesting. Thanks for your input.

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    July 27, 2018

    you should be able to add a className:

    this.mc.className='correct_class';

    because of timing issues (you'll need to add jquery before using addClass() ) i'm not sure addClass() will work that way you want.

    avid_body16B8
    Legend
    July 27, 2018

    Thank you for your answer.   I guess I will have to experiment.