不显示自举滑块图像

时间:2015-09-03 10:45:49

标签: jquery twitter-bootstrap

这是代码,

 <header id="myCarousel" class="carousel slide">
        <!-- Indicators -->
        <ol class="carousel-indicators">
            <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
            <li data-target="#myCarousel" data-slide-to="1"></li>
            <li data-target="#myCarousel" data-slide-to="2"></li>
        </ol>

        <!-- Wrapper for slides -->
        <div class="carousel-inner">
            <div class="item active">
                <div class="fill" style="background-image:url(http://s23.postimg.org/9nq4ybppn/home_slider1.jpg one);"></div>
                <div class="carousel-caption">
                    <h2>Caption 1</h2>
                </div>
            </div>
            <div class="item">
                <div class="fill" style="background-image:url(http://s23.postimg.org/su3c1i67f/home_slider2.jpg two);"></div>
                <div class="carousel-caption">
                    <h2>Caption 2</h2>
                </div>
            </div>
            <div class="item">
                <div class="fill" style="background-image:url(http://s23.postimg.org/v17kpfbhn/home_slider3.jpg three);"></div>
                <div class="carousel-caption">
                    <h2>Caption 3</h2>
                </div>
            </div>
        </div>
 </header>

我正在使用bootstrap,但它不能正常工作..图像不会显示..

我可以知道我错过了什么..?

感谢。

2 个答案:

答案 0 :(得分:1)

您可以使用此代码,也许它的效果很好。

<header id="myCarousel" class="carousel slide">
        <!-- Indicators -->
        <ol class="carousel-indicators">
            <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
            <li data-target="#myCarousel" data-slide-to="1"></li>
            <li data-target="#myCarousel" data-slide-to="2"></li>
        </ol>

        <!-- Wrapper for slides -->
        <div class="carousel-inner">
            <div class="item active">
                <div class="fill" style="background: url(http://s23.postimg.org/9nq4ybppn/home_slider1.jpg) no-repeat center center;background-size: 100%;min-height: 500px; "></div>

                <div class="carousel-caption">
                    <h2>Caption 1</h2>
                </div>
            </div>
            <div class="item">
                <div class="fill" style="background: url(http://s23.postimg.org/su3c1i67f/home_slider2.jpg) no-repeat center center;background-size: 100%;min-height: 500px; "></div>
                <div class="carousel-caption">
                    <h2>Caption 2</h2>
                </div>
            </div>
            <div class="item">
                <div class="fill" style="background: url(http://s23.postimg.org/v17kpfbhn/home_slider3.jpg) no-repeat center center;background-size: 100%;min-height: 500px; "></div>
                <div class="carousel-caption">
                    <h2>Caption 3</h2>
                </div>
            </div>
        </div>
    </header>

答案 1 :(得分:0)

  

Via data attributes

     

使用数据属性轻松控制轮播的位置。   data-slide接受关键字prevnext,后者会改变关键字data-slide-todata-slide-to="2"   滑动位置相对于其当前位置。或者,使用   0将原始幻灯片索引传递给轮播   data-ride="carousel",将幻灯片位置移动到特定位置   索引以data-ride="carousel"开头。

     

<div class="carousel-inner" role="listbox"> <div class="item active"> <img src="..." alt="..."> <div class="carousel-caption"> ... </div> </div> <div class="item"> <img src="..." alt="..."> <div class="carousel-caption"> ... </div> </div> ... </div> 属性用于将轮播标记为   动画从页面加载开始。它不能与之结合使用   (冗余和不必要的)显式JavaScript初始化   相同的旋转木马。

我的猜测是你必须将ALTER PROCEDURE [dbo].[GetVisitListFiltered] @sitekey int, @VisitNo int = NULL, @DNS varchar(max) = NULL, @SessionStarted varchar(15) = '01/01/1900', @Page varchar(max) = NULL, @SecondsOnSite int = NULL, @SecondsOnSiteRange int = NULL, @Pages int = NULL, @Cost int = NULL, @City varchar(max) = NULL, @Country varchar(max) = NULL, @Keywords varchar(max) = NULL, @Referrer varchar(max) = NULL AS BEGIN BEGIN TRY SET @SecondsOnSiteRange = CASE @SecondsOnSiteRange WHEN 1 THEN '=' WHEN 2 THEN '>' WHEN 3 THEN '<' ELSE NULL END DECLARE @SQL NVARCHAR(MAX) , @SQLParams NVARCHAR(MAX); SET @SQL = N' SELECT VKey, VisitIP, SiteKey, Alert, AlertNo, VisitNo, Invited, Chatted, Prospect, Customer, HackRaised, Spider, Cost, Revenue, Visits, FirstDate, TotalCost, TotalRevenue, OperatingSystem, Browser, SearchEngine, Referrer, Keywords, ReferrerQuery, Name, Email, Company, Telephone, Fax, Street, City, Zip, Country, Web, Organization, CRMID, Notes, DNS, Region, FirstAlert, FirstVisitReferrer, ProspectTypes, VisitDate, SecondsOnSite, Page FROM dbo.VisitDetail WHERE SiteKey = @p0'; IF NULLIF(@VisitNo, '') IS NOT NULL SET @SQL += N' AND VisitNo = @p1'; IF NULLIF(@DNS, '') IS NOT NULL SET @SQL += N' AND DNS = @p2'; IF NULLIF(@SessionStarted, '01/01/1900') IS NOT NULL SET @SQL += N' AND VisitDate between @p3 and @p3 23:59:59'; IF NULLIF(@Page, '') IS NOT NULL SET @SQL += N' AND Page = @p4'; IF NULLIF(@SecondsOnSite, '') IS NOT NULL AND NULLIF(@SecondsOnSiteRange, '') IS NOT NULL SET @SQL += N' AND SecondsOnSite' + '@p12' + '@p5'; IF NULLIF(@Pages, '') IS NOT NULL SET @SQL += N' AND PagesSeen = @p6'; IF NULLIF(@Cost, '') IS NOT NULL SET @SQL += N' AND Cost = @p7'; IF NULLIF(@City, '') IS NOT NULL SET @SQL += N' AND City = @p8'; IF NULLIF(@Country, '') IS NOT NULL SET @SQL += N' AND Country = @p9'; IF NULLIF(@Keywords, '') IS NOT NULL SET @SQL += N' AND Keywords = @p10'; IF NULLIF(@Referrer, '') IS NOT NULL SET @SQL += N' AND ReferrerQuery = @p11'; SET @SQLParams = N' @p0 INT , @p1 INT , @p2 VARCHAR(MAX) , @p3 VARCHAR(15) , @p4 VARCHAR(MAX) , @p5 INT , @p6 INT , @p7 INT , @p8 VARCHAR(MAX) , @p9 VARCHAR(MAX) , @p10 VARCHAR(MAX) , @p11 VARCHAR(MAX) , @p12 VARCHAR(10)'; EXECUTE sp_executesql @SQL , @SQLParams , @p0 = @SiteKey , @p1 = @VisitNo , @p2 = @DNS , @p3 = @SessionStarted , @p4 = @Page , @p5 = @SecondsOnSite , @p6 = @Pages , @p7 = @Cost , @p8 = @City , @p9 = @Country , @p10 = @Keywords , @p11 = @Referrer , @p12 = @SecondsOnSiteRange; END TRY BEGIN CATCH SELECT ERROR_MESSAGE(); END CATCH END 添加到轮播中。

修改 我还注意到the example on the Bootstrap website使用了稍微不同的html:

IF NULLIF(@SessionStarted, '01/01/1900') IS NOT NULL 
SET @SQL += N' AND VisitDate between @p3 and @p3 23:59:59';