1

私は自分のサイト jquery effect bx-slider Bx-Slider Pageに適用しましたが、今は css の前と次の矢印に適用します。画像に適用しましたが、cssの妥当性も適用します。これは jquery.bxslide.js コードの一部です。

var defaults = {
        mode: 'horizontal',                                 // 'horizontal', 'vertical', 'fade'
        infiniteLoop: true,                                 // true, false - display first slide after last
        hideControlOnEnd: false,                        // true, false - if true, will hide 'next' control on last slide and 'prev' control on first
        controls: true,                                         // true, false - previous and next controls
        speed: 700,                                                 // integer - in ms, duration of time slide transitions will occupy
        easing: 'swing',                    // used with jquery.easing.1.3.js - see http://gsgd.co.uk/sandbox/jquery/easing/ for available options
        pager: false,                                               // true / false - display a pager
        pagerSelector: null,                                // jQuery selector - element to contain the pager. ex: '#pager'
        pagerType: 'full',                                  // 'full', 'short' - if 'full' pager displays 1,2,3... if 'short' pager displays 1 / 4
        pagerLocation: 'bottom',                        // 'bottom', 'top' - location of pager
        pagerShortSeparator: '/',                       // string - ex: 'of' pager would display 1 of 4
        pagerActiveClass: 'pager-active',       // string - classname attached to the active pager link
        nextText: '',                                       // string - text displayed for 'next' control
        nextImage: 'images/right_arrow.png',                                            // string - filepath of image used for 'next' control. ex: 'images/next.jpg'
        nextSelector: null,                                 // jQuery selector - element to contain the next control. ex: '#next'
        prevText: '',                                       // string - text displayed for 'previous' control
        prevImage: 'images/left_arrow.png',                                         // string - filepath of image used for 'previous' control. ex: 'images/prev.jpg'
        prevSelector: null,                                 // jQuery selector - element to contain the previous control. ex: '#next'
        captions: false,                                        // true, false - display image captions (reads the image 'title' tag)
        captionsSelector: null,                         // jQuery selector - element to contain the captions. ex: '#captions'
        auto: false,                                                // true, false - make slideshow change automatically
        autoDirection: 'next',                          // 'next', 'prev' - direction in which auto show will traverse
        autoControls: false,                                // true, false - show 'start' and 'stop' controls for auto show
        autoControlsSelector: null,                 // jQuery selector - element to contain the auto controls. ex: '#auto-controls'
        autoStart: true,                                        // true, false - if false show will wait for 'start' control to activate
        autoHover: false,                                       // true, false - if true show will pause on mouseover
        autoDelay: 0,                       // integer - in ms, the amount of time before starting the auto show
        pause: 3000,                                                // integer - in ms, the duration between each slide transition
        startText: 'start',                                 // string - text displayed for 'start' control
        startImage: '',                                         // string - filepath of image used for 'start' control. ex: 'images/start.jpg'
        stopText: 'stop',                                       // string - text displayed for 'stop' control
        stopImage: '',                                          // string - filepath of image used for 'stop' control. ex: 'images/stop.jpg'
        ticker: false,          

ご覧のとおり、次/前のセレクターをコントロールに設定する必要がありますが、セレクターを設定するとコントロールが消えてしまいました。なぜですか?

4

1 に答える 1

1

スライダーがあるページのjQueryに必要な要素を入力する必要があります。

スライダーが index.html にある場合は、そのページを開き、次のコードを見つけます

<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<script src="jquery.bxSlider.min.js" type="text/javascript"></script>
<script type="text/javascript">

$(function(){
  $('#slider1').bxSlider({
  });
});

この中に必要な要素を入れます。したがって、次と前の矢印画像を追加するには、次のようになります

            <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
            <script src="jquery.bxSlider.min.js" type="text/javascript"></script>
            <script type="text/javascript">

$(function(){
  $('#slider1').bxSlider({
    nextImage: 'url of image goes here',
    prevImage: 'url of image goes here',
    prevText: '',   
    nextText: '',
  });
});

また、「prevText」と nextText を追加し、それらを空白のままにしました。そうしないと、画像とテキストの両方が表示されます。

ThreeTwoを助けることを願っています

于 2012-05-08T10:03:23.790 に答える