Jquery Flexslider - can't see navigational images (manualControl)
Posted
by
Kim Thomas
on Stack Overflow
See other posts from Stack Overflow
or by Kim Thomas
Published on 2012-03-29T00:52:51Z
Indexed on
2012/03/29
17:30 UTC
Read the original article
Hit count: 512
jQuery
I've spent a lot of time looking at the post on 3/13/12 re: manual controls, but isn't getting me all the way there...probably because I don't know jquery. Sorry, newbie on board.
I'm trying to get the right/left arrows to show, as well as the 1, 2, 3...at the bottom. They are there, I see the lists on Firebug, just don't know how to add them to the "hook" (?) so they appear.
Here is the code I have in header:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="jquery.flexslider.js"></script>
<script type="text/javascript" charset="utf-8">
$(window).load(function() {
$('.flexslider').flexslider({
animation: "slide",
slideshow: false,
controlNav: true,
manualControls: ".flex-control-nav li a",
controlsContainer: ".flex-container"
});
});
</script>
Here is my html:
<div class="flex-container">
<div class="flexslider">
<ul class="slides">
<li><img src="images/tah_home.jpg" alt="taylor art house home page" width="600" height="320"/>
<p class="flex-caption">Taylor Art House Home Page</p></li>
<li><img src="images/tah_blog.jpg" alt="taylor art house blog page" width="600" height="320" />
<p class="flex-caption">We created a blog that fits seemlessly into Taylor Art House's look</p></li>
<li><img src="images/tah_artwork_page.jpg" alt="taylor art house art page" width="600" height="320" />
<p class="flex-caption">One of Taylor Art House's gallery pages, using a Wordpress plugin</p></li>
<li><img src="images/tah_arch_portfolio.jpg" alt="jon taylor architecture portfolio page" width="600" height="320" />
<p class="flex-caption">We created links to toggle from TAH to Jon Taylor Architecture</p></li>
</ul>
</div><!--end flexsider-->
</div><!--end flex-container-->
Here is the Flexslider CSS:
/*
* jQuery FlexSlider v1.8
* http://www.woothemes.com/flexslider/
*
* Copyright 2012 WooThemes
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
/* Browser Resets */
.flex-container a:active,
.flexslider a:active,
.flex-container a:focus,
.flexslider a:focus {outline: none;}
.slides,
.flex-control-nav,
.flex-direction-nav {margin: 0; padding: 0; list-style: none;}
/* FlexSlider Necessary Styles
*********************************/
.flexslider {
width: 100%;
margin: 0;
padding: 0;
}
.flexslider .slides > li {
display: none;
-webkit-backface-visibility: hidden;
}
/* Hide the slides before the JS is loaded. Avoids image jumping */
.flexslider .slides img {
max-width: 100%;
display: block;
}
.flex-pauseplay span {
text-transform: capitalize;
}
/* Clearfix for the .slides element */
.slides:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
html[xmlns] .slides {
display: block;
}
* html .slides {
height: 1%;
}
/* No JavaScript Fallback */
/* If you are not using another script, such as Modernizr, make sure you
* include js that eliminates this class on page load */
.no-js .slides > li:first-child {
display: block;
}
/* FlexSlider Default Theme
*********************************/
.flexslider {
width: 600px;
background: #fff;
border: 4px solid #999;
position: relative;
margin: 30px 0;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px; zoom: 1;
}
.flexslider .slides {
zoom: 1;
}
.flexslider .slides > li {
position: relative;
}
/* Suggested container for "Slide" animation setups. Can replace this with your own, if you wish */
.flex-container {
zoom: 1;
position: relative;
margin-left:100px;
}
/* Caption style */
/* IE rgba() hack */
.flex-caption {
background:none;
-ms-filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4C000000,endColorstr=#4C000000);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4C000000,endColorstr=#4C000000);
zoom: 1;
}
.flex-caption {
width: 96%;
padding: 2%;
margin: 0;
position: absolute;
left: 0;
bottom: 0;
background: rgba(0,0,0,.3);
color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,.3);
font-size: 14px;
line-height: 18px;
}
/* Direction Nav */
.flex-direction-nav {
height: 0;
}
.flex-direction-nav li a {
width: 52px;
height: 52px;
margin: -13px 0 0;
display: block;
background: url(theme/bg_direction_nav.png) no-repeat;
position: absolute;
top: 50%;
cursor: pointer;
text-indent: -999em;
}
.flex-direction-nav li .next {
background-position: -52px 0; right: -21px;
}
.flex-direction-nav li .prev {
left: -20px;
}
.flex-direction-nav li .disabled {
opacity: .3;
filter:alpha(opacity=30);
cursor: default;
}
/* Control Nav */
.flex-control-nav {
width: 100%;
position: absolute;
bottom: -30px;
text-align: center;
}
.flex-control-nav li {
margin: 0 0 0 5px;
display: inline-block;
zoom: 1;
*display: inline;
}
.flex-control-nav li:first-child {
margin: 0;
}
.flex-control-nav li a {
width: 13px;
height: 13px;
display: block;
background: url(theme/bg_control_nav.png) no-repeat;
cursor: pointer;
text-indent: -999em;
}
.flex-control-nav li a:hover {
background-position: 0 -13px;
}
.flex-control-nav li a.active {
background-position: 0 -26px;
cursor: default;
}
Here is how it appears in Firebug:
<div class="flex-container">
<div class="flexslider" style="overflow: hidden;">
<ul class="slides" style="width: 1200%; margin-left: -1800px;">
<li class="clone" style="width: 600px; float: left; display: block;">
<li style="width: 600px; float: left; display: block;">
<li style="width: 600px; float: left; display: block;">
<li style="width: 600px; float: left; display: block;">
<li style="width: 600px; float: left; display: block;">
<li class="clone" style="width: 600px; float: left; display: block;">
</ul>
</div>
<ol class="flex-control-nav">
<li>
<a class="">1</a>
</li>
<li>
<li>
<li>
</ol>
<ul class="flex-direction-nav">
<li>
<a class="prev" href="#">Previous</a>
</li>
<li>
<a class="next" href="#">Next</a>
</li>
</ul>
</div>
Finally, here is a link to the jsFiddle file (I saw someone wanted that in other flexslider post): http://jsfiddle.net/kthms/Wxmsp/
Link to page: http://www.kajortdesigns.com/tah.php
I've tried every combo of class from the CSS in the manualControl: "", but I'm just guessing.
If anyone can help this newbie out, I would be very appreciative. Explicit instructions are always appreciated.
© Stack Overflow or respective owner