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

How to define opacity in Animate CC Html canvas with coding?

Guest
Dec 04, 2016 Dec 04, 2016

I have a picture in html canvas.

I want to change the opacity when I click  on it.....

which js code set the opacity?

[Moved from the non-specific Coding Corner to a product-specific support forum - moderator]

[Although, this possibly might be Edge Animate and not Animate, so please say something if it's in the wrong spot - same moderator]

3.6K
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

correct answers 1 Correct answer

LEGEND , Feb 11, 2017 Feb 11, 2017

Attempting to apply CSS styles to CreateJS canvas objects does nothing.

The correct property to set is alpha.

Translate
Community Expert ,
Dec 05, 2016 Dec 05, 2016

You could use something like...

onclick="getElementById('yourimageid').style.opacity = .5"

...to change the css style when it's clicked.

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
LEGEND ,
Feb 11, 2017 Feb 11, 2017
LATEST

Attempting to apply CSS styles to CreateJS canvas objects does nothing.

The correct property to set is alpha.

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