How to make translateY() function in JS ?
Answers
Answered by
3
Answer:
A function in JavaScript is similar to a procedure—a set of statements that performs a task or calculates a value, but for a procedure to qualify as a function, it should take some input and return an output where there is some obvious relationship between the input and the output.
Answered by
42
ʏᴏᴜ ᴄᴀɴ ᴘᴀss ᴀɴʏ ᴛʀᴀɴsғᴏʀᴍ ᴘʀᴏᴘᴇʀᴛʏ ᴀs ᴀ sᴛʀɪɴɢ.
ʜᴏᴡ?
ɪᴛ ᴄᴀɴ ʙᴇ ᴅᴏɴᴇ ʟɪᴋᴇ ᴛʜɪs;
ᴅɪᴠ.sᴛʏʟᴇ.ᴛʀᴀɴsғᴏʀᴍ = "ᴛʀᴀɴsʟᴀᴛᴇ(x,ʏ)"
ɪ ғɪɴᴅ ᴏᴜᴛ ᴛʜᴀᴛ ɪғ ɪ ᴡʀɪᴛᴇ
ᴅɪᴠ.sᴛʏʟᴇ.ᴛʀᴀɴsғᴏʀᴍ = "ᴛʀᴀɴsʟᴀᴛᴇ(sᴏᴍᴇᴠᴀʟᴜᴇ)"
ɪᴛ ᴏɴʟʏ ᴀғғᴇᴄᴛs x ᴀxᴇs.
"ᴛʀᴀɴsʟᴀᴛᴇ-ʏ(sᴏᴍᴇᴠᴀʟᴜᴇ)" ᴏʀ "ᴛʀᴀɴsʟᴀᴛᴇ-x(sᴏᴍᴇᴠᴀʟᴜᴇ)"
ᴅɪᴅ ɴᴏᴛ ᴡᴏʀᴋ ᴏᴜᴛ.
ᴏʀ ʏᴏᴜ ᴄᴀɴ ᴜsᴇ ʀᴏᴛᴀᴛᴇ ᴘʀᴏᴘᴇʀᴛʏ;
ᴅɪᴠ.sᴛʏʟᴇ.ᴛʀᴀɴsғᴏʀᴍ = "ʀᴏᴛᴀᴛᴇ(50ᴘx
_______________________________
Similar questions
English,
1 month ago
CBSE BOARD X,
1 month ago
Social Sciences,
1 month ago
English,
2 months ago
Economy,
10 months ago
English,
10 months ago