I'm building a movie suggestion app that will suggest movies based on the weather of the users geo-location.
The main problem I'm having is that I would like to be able to make it a random title and poster of the movie from the selection of movies that are attached to a single weather condition.
Right now I have a button that in my html that basically just moves you down the list and stops at the last one. How can I make it so the button generates a random movie title and the poster to go along with it?
if (icon === "wind") {
$("#jumbo").css(
"background-image",
"url(https://www.movieposter.com/posters/archive/main/66/MPW-33473)"
);
$("body").css(
"background-image",
"url(https://i.ytimg.com/vi/Gfr8MExtDYI/maxresdefault.jpg)"
);
$("#cTemp").html("Twister");
$("#new").click(function() {
$("#jumbo").css(
"background-image",
"url(https://images-na.ssl-images-amazon.com/images/I/517KxZHTGGL.jpg)"
);
$("#cTemp").html("Cast Away");
$("#new").click(function() {
$("#jumbo").css(
"background-image",
"url(http://www.gstatic.com/tv/thumb/movieposters/34439/p34439_p_v8_au.jpg)"
);
$("#cTemp").html("The Day After Tomorrow");
$("#new").click(function() {
$("#jumbo").css(
"background-image",
"url(http://www.gstatic.com/tv/thumb/movieposters/193479/p193479_p_v8_an.jpg)"
);
$("#cTemp").html("2012");
$("#new").click(function() {
$("#jumbo").css(
"background-image",
"url(https://i.pinimg.com/originals/dc/0c/ff/dc0cff626f513bd5fc74bb9dbde70f17.jpg)"
);
$("#cTemp").html("Gone With The Wind");
$("#new").click(function() {
$("#jumbo").css(
"background-image",
"url(https://images-na.ssl-images-amazon.com/images/I/81dTEnx805L._RI_.jpg)"
);
$("#cTemp").html("The Perfect Storm");
});
});
});
});
});
}