简体   繁体   中英

Changing Articulate Storyline text color using jquery?

Here is the code that I'm using to animate a text in Storyline using jQuery:

var item = $('[aria-label="myText"] svg')

$(item).toggle( "puff" );

this code is working.

But when I tried to change the color of the text using jQuery nothing happens...

if I can use jQuery to animate a text why I can't use it to change the color of it?

Here are the codes I've tried: (Am I missing something?!)

var item = $('[aria-label="spinner"] svg')

$(item).attr('style','color: green;');

and also :

var item = $('[aria-label="spinner"] svg')

$(item).css('color', 'red');

I can guess an SVG.. normally an svg containing text has also a <text></text> and svg are not using color but fill instead in the CSS.

Changing to this should work:

var item = $('[aria-label="spinner"] svg text')

$(item).css('fill', 'red');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM