Created
September 14, 2012 14:18
-
-
Save jorgepinon/3722178 to your computer and use it in GitHub Desktop.
module - responsive banner with multiple flexslider carousels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
uses jQuery FlexSlider v2.1 | |
by Tyler Smith ((@mbmufffin) | |
--> | |
<!DOCTYPE html> | |
<html lang="en-us"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<style> | |
.img-wrap { display:block; max-width: 240px; } | |
.img-wrap img { | |
width: 100%; | |
height: auto !important; /* force correct ratio */ | |
} | |
/* module - banner */ | |
.banner { | |
float: left; | |
width: 100%; | |
background-color: #676772; | |
color: #EFEFF1; | |
border-top: solid 1px #fff; | |
margin-bottom: 1.5em; | |
} | |
.banner-hdr { padding: 0 1em; } | |
/* module - cell-row */ | |
.cell-row { | |
margin: 0 auto; | |
text-align: center; | |
max-height: 240px; /* based on max image height and site design */ | |
overflow: hidden; | |
} | |
.cell { | |
display: inline-block; | |
margin: 0 auto; | |
min-width:120px; | |
} | |
.cell .img { float: left; } | |
.cell-buttons { | |
display:none; | |
max-width: 240px; | |
min-width: 100px; | |
} | |
[class*="cell-banner-"] { | |
width: 100%; | |
display: none; | |
margin: 0 auto; | |
} | |
[class*="cell-banner-"] .img { width: 100%; display: inline-block; } | |
.cell-banner-240 { max-width: 240px; } | |
.cell-banner-920 { max-width: 920px; } | |
.cell-banner-720 { max-width: 720px; } | |
.cell-banner-480 { max-width: 480px; } | |
.cell-banner-360 { max-width: 360px; } | |
.cell-banner-240 { max-width: 240px; } | |
/* state - cell-row */ | |
.isSticky { display: block; } | |
@media screen and (min-width: 600px) { | |
[class*="cell-banner-"] { width: auto; display: inline-block; } | |
} | |
@media screen and (min-width: 768px) { | |
.cell-banner-360 + .cell-buttons { display:block; width: 33.33%; } | |
} | |
@media screen and (min-width: 960px) { | |
[class*="-240"] { width: 240px; } | |
.cell-buttons { float:left; display:inline-block; } | |
.cell { float:left; } | |
[class*="cell-banner-"] .img { | |
width: auto; /* for chrome to show full image width */ | |
} | |
} | |
</style> | |
</head> | |
<body> | |
<div class="banner"> | |
<header class="banner-hdr"> | |
<hgroup> | |
<h1>720(banner) + 240(buttons)</h1> | |
</hgroup> | |
</header> | |
<div class="l-constrained l-max960"> | |
<div class="row cell-row"> | |
<div class="cell cell-banner-720 isSticky"> | |
<div class="flexslider"> | |
<ul class="slides list-unstyled"> | |
<li class=""> | |
<a href="/music"><img class="img" src="http://ipsumimage.appspot.com/720x240?b=999&f=ccc&s=30&l=720banner1" alt=""></a> | |
</li> | |
<li class="hidden"> | |
<a href="/movies"><img class="img" src="http://ipsumimage.appspot.com/720x240?b=68a&f=ccc&s=30&l=720banner2" alt=""></a> | |
</li> | |
<li class="hidden"> | |
<a href="/tv"><img class="img" src="http://ipsumimage.appspot.com/720x240?b=ccc&f=999&s=30&l=720banner3" alt=""></a> | |
</li> | |
</ul> | |
</div> | |
</div> | |
<div class="cell cell-buttons cell-buttons-240 promo-secondary l-min768"> | |
<ul class="list-unstyled"> | |
<li> | |
<a href="/movies"><img class="img" src="http://ipsumimage.appspot.com/240x80?b=555&f=ccc&s=20&l=240buttonMovies" alt=""></a> | |
</li> | |
<li> | |
<a href="/music"><img class="img" src="http://ipsumimage.appspot.com/240x80?b=222&f=ccc&s=20&l=240buttonMusic" alt=""></a> | |
</li> | |
<li> | |
<a href="/music"><img class="img" src="http://ipsumimage.appspot.com/240x80?b=777&f=ccc&s=20&l=240buttonGenre" alt=""></a> | |
</li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
</div> <!-- banner --> | |
<div class="banner"> | |
<header class="banner-hdr"> | |
<hgroup> | |
<h1>240(buttons) + 480(banner) + 240(banner)</h1> | |
</hgroup> | |
</header> | |
<div class="l-constrained l-max960"> | |
<div class="row cell-row"> | |
<div class="cell cell-buttons cell-buttons-240 l-min1024"> | |
<ul class="list-unstyled"> | |
<li> | |
<a class="img-wrap" href="#"><img class="img" src="http://ipsumimage.appspot.com/240x80?b=333&f=666&s=20&l=240button1" alt=""></a> | |
</li> | |
<li> | |
<a class="img-wrap" href="/movies"><img class="img" src="http://ipsumimage.appspot.com/240x80?b=777&f=ccc&s=20&l=240button2" alt=""></a> | |
</li> | |
<li> | |
<a class="img-wrap" href="#"><img class="img" src="http://ipsumimage.appspot.com/240x80?b=aaa&f=222&s=20&l=240button3" alt=""></a> | |
</li> | |
</ul> | |
</div> | |
<div class="cell cell-banner-480 isSticky"> | |
<div class="flexslider"> | |
<ul class="slides list-unstyled"> | |
<li class=""> | |
<a href="#"><img class="img" src="http://ipsumimage.appspot.com/480x240?b=111&f=666&s=30&l=480banner1" alt=""></a> | |
</li> | |
<li class="hidden"> | |
<a href="#"><img class="img" src="http://ipsumimage.appspot.com/480x240?b=888&f=bbb&s=30&l=480banner2" alt=""></a> | |
</li> | |
<li class="hidden"> | |
<a href="#"><img class="img" src="http://ipsumimage.appspot.com/480x240?b=ccc&f=666&s=30&l=480banner3" alt=""></a> | |
</li> | |
</ul> | |
</div> | |
</div> | |
<div class="cell cell-banner-240 isSecondary"> | |
<div class="flexslider"> | |
<ul class="slides list-unstyled"> | |
<li class=""> | |
<a href="#"><img class="img" src="http://ipsumimage.appspot.com/240x240?b=369&f=ccc&s=30&l=240banner1" alt=""></a> | |
</li> | |
<li class="hidden"> | |
<a href="#"><img class="img" src="http://ipsumimage.appspot.com/240x240?b=789&f=ccc&s=30&l=240banner2" alt=""></a> | |
</li> | |
<li class="hidden"> | |
<a href="#"><img class="img" src="http://ipsumimage.appspot.com/240x240?b=234&f=ccc&s=30&l=240banner3" alt=""></a> | |
</li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> <!-- banner --> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script type="text/javascript" src="jquery.flexslider.js"></script> | |
<script type="text/javascript"> | |
$(".flexslider").flexslider({ | |
animation: "fade", | |
slideshowSpeed: 5000, | |
controlNav: false, | |
directionNav: false, | |
start: function(){ | |
$(this.selector).siblings().removeClass("hidden"); | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment