diff --git a/css/mediarack.css b/css/mediarack.css index 30223d1b6054947c63a22e7d63e876e0a380ea5a..2b2a0a02335c9e7c4c8427201be374f54adfab20 100644 --- a/css/mediarack.css +++ b/css/mediarack.css @@ -85,10 +85,8 @@ div.epLabel { } .jcarousel-wrapper { + margin: 20px auto; position: relative; - width: 1000px; - margin-left: auto; - margin-right: auto; } /** Carousel **/ @@ -96,7 +94,7 @@ div.epLabel { .jcarousel { position: relative; overflow: hidden; - width: 1000px; + width: 100%; } .jcarousel ul { @@ -105,13 +103,17 @@ div.epLabel { list-style: none; margin: 0; padding: 0; - text-align: center; } .jcarousel li { + width: 200px; float: left; - width: 200px; - margin: 10px 0; +} + +.jcarousel img { + margin: 0 10px; + max-width: 150px; + height: auto !important; } /** Carousel Controls **/ @@ -119,7 +121,8 @@ div.epLabel { .jcarousel-control-prev, .jcarousel-control-next { position: absolute; - top: 100px; + top: 50%; + margin-top: -15px; width: 30px; height: 30px; text-align: center; @@ -129,28 +132,17 @@ div.epLabel { text-shadow: 0 0 1px #000; font: 24px/27px Arial, sans-serif; -webkit-border-radius: 30px; - -moz-border-radius: 30px; - border-radius: 30px; - -webkit-box-shadow: 0 0 2px #999; - -moz-box-shadow: 0 0 2px #999; - box-shadow: 0 0 2px #999; + -moz-border-radius: 30px; + border-radius: 30px; + -webkit-box-shadow: 0 0 4px #F0EFE7; + -moz-box-shadow: 0 0 4px #F0EFE7; + box-shadow: 0 0 4px #F0EFE7; } .jcarousel-control-prev { - left: -50px; + left: 15px; } .jcarousel-control-next { - right: -50px; -} - -.jcarousel-control-prev:hover span, -.jcarousel-control-next:hover span { - display: block; -} - -.jcarousel-control-prev.inactive, -.jcarousel-control-next.inactive { - opacity: .5; - cursor: default; + right: 15px; } diff --git a/js/mediarack.js b/js/mediarack.js index 9cb1a75c7dc1626eb65f8074e2c12d5fc0093987..be1a6a12159b20c2ff062ebad20b1d56b7cea1ad 100644 --- a/js/mediarack.js +++ b/js/mediarack.js @@ -46,7 +46,23 @@ function getLatest() { var liLatestItem = $('<li><img src="api.php?get=poster&show='+escape(ep.show)+'" /><div class="epLabel">'+ep.show+'<br />'+ep.episode+'<br />'+ep.name+'<br />'+ep.airdate+'</div></li>'); ulLatestContainer.append(liLatestItem); }); - $('.jcarousel').jcarousel({ + $('.jcarousel') + .on('jcarousel:create jcarousel:reload', function() { + var element = $(this), + width = element.innerWidth(); + + if (width > 1000) { + width = width / 5; + } else if (width > 800) { + width = width / 4; + } else if (width > 590) { + width = width / 3; + } else if (width < 590) { + width = width / 2; + } + element.jcarousel('items').css('width', width + 'px'); + }) + .jcarousel({ wrap: 'both' }); $('.jcarousel-control-prev')