Week 3 – JavaScript Excercise (with BONUS) – Jiannan Shi

Link: https://imanas.shanghai.nyu.edu/~js9686/ExcerciseFeb28/

Description:

Inspired by Leon, I modified the syntax “-webkit-transform” in CSS into “webkitTransform” in JavaScript, and it set the “scaleX” to be (1) if I want it to keep it original, and (-1) to make it flipped. The cat is amazingly flipped without me changing the source of the image!

Difficulty and solution:

I want to play with the caption by adding multiple styles into the font. However, I realized that if I do the “document.getElementById(“xxx”).style.*******” in my self-defined function, it would only display the top first style. Referencing this link, I used the syntax .style.cssText = “*****”, and filled the **** part with CSS syntax. My caption is amazingly displaying multiple styles at the same time! 

Leave a Reply