Why this code is not working? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why this code is not working?

This image slider is not working. And how to put figcaption under a image? https://code.sololearn.com/W69U8i9w8BH4/?ref=app

27th Nov 2020, 3:41 PM
˜”*°•.˜”*°• Mohan 333 •°*”˜.•°*”˜
˜”*°•.˜”*°• Mohan 333 •°*”˜.•°*”˜ - avatar
4 Answers
+ 1
Mohan 333 Assign event to button and call functions like : <button onclick="pre()">pre</button> <button onclick="next()">next</button> Do like : document.getElementById("img1").src=images[n]; Change var num to var n ; you are using all times n
27th Nov 2020, 3:59 PM
Jayakrishna 🇮🇳
0
It should be <button onclick="pre()"> otherwise it's basically a useless button And you are using n, but you ment num And script should be after the buttons
27th Nov 2020, 3:59 PM
Angelo
Angelo - avatar
0
Jayakrishna🇮🇳 how to put figcaption under a image?
27th Nov 2020, 4:26 PM
˜”*°•.˜”*°• Mohan 333 •°*”˜.•°*”˜
˜”*°•.˜”*°• Mohan 333 •°*”˜.•°*”˜ - avatar
0
Mohan 333 defaultly it will adjust automatically either top or bottom. (i think bottom only, not sure). See that removing all css, you can at bottom.. If not work make into a table form and add caption - side : bottom; figure { display: table; } figcaption { display: table-caption; caption-side: bottom; }
28th Nov 2020, 1:50 PM
Jayakrishna 🇮🇳