@sankaragomathym
Posted
Hey Giovanni! I guess you have complicated your code. Just keep it simple. Have 2 containers A and B (each inclusive of image, text, name). On initial load, let B have 'display:none'. In JS all you have to do is toggle displays of A and B based on ID or whatever selector you use.
The above is fine since there are only 2 testimonials. But when we have to deal with more number, instead of having containers for each testimonial, we can simply have one container in HTML and the content stored in JSON format. When slider is clicked, just fill in the corresponding content using JS.
Hope this helps.. You can refer my code if needed.
@Giovnni
Posted
@sankaragomathym Hello Sankara !
Thanks for your feedback, I had a look on your code so I could have an idea about how to do it in an efficient and easier way. It's very clever to use JSON format to store the content ! Since I'm not familiar with this format I haven't though about using it but like you said, on a bigger project it's mandatory to keep the code clean and not overloaded. I will definitely use this solution whenever I come across similar situation and will update the project ! :)