jQuery Flexslider - 看不到导航图像(manualControl)

时间:2012-03-29 00:52:51

标签: jquery

我花了很多时间看看3/13/12 re:手动控制的帖子,但是并没有让我一路走到那里......可能是因为我不知道jquery。对不起,新手在船上。

我正在尝试显示右/左箭头,以及底部的1,2,3 ......他们在那里,我看到Firebug上的列表,只是不知道如何将它们添加到“钩子”(?)所以它们出现。

以下是标题中的代码:

<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>

这是我的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--> 

这是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;
}

以下是它在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>

最后,这里是jsFiddle文件的链接(我看到有人希望在其他flexslider文章中): http://jsfiddle.net/kthms/Wxmsp/

指向页面的链接:http://www.kajortdesigns.com/tah.php

我在manualControl中尝试了CSS中的每个类的组合:“”,但我只是在猜测。

如果有人可以帮助这个新手,我会非常感激。明确的指示总是受到赞赏。

1 个答案:

答案 0 :(得分:2)

我遇到了同样的问题。我通过将flexslider.css中的1的不透明度更改为0而不是flex-direction-nav a来解决此问题