Hi and hope you can help. My JavaScript isn't that hot and I have tried searching but had no luck with find the correct method.
I am trying to add css background-image to a div (.jumbotron) but dynamically change the url depending on the screen size. The image will be picked up from https://unsplash.it where the url can be coded to the dimensions required i.e. https://unsplash.it/200/300
<script type="text/javascript">
function setBackground () {
$('jumbotron').css('background-image', 'url(https://unsplash.it/' + $(window).height(); + '/' + $(window).width();')');
}
</script>
I hope this make sense and thanks in advance
.jumbotronor#jumbotron). Also, you have an extra>on the closing script tag.