2015-07-21 56 views
0

我跟着这个guide并加载了一切。到目前为止,一切正常,但后台网址似乎不适用于任何css文件。我正在添加我的源代码。我已经研究了大约50篇文章,但都没有讨论如何做到这一点。Nivo滑块不工作Laravel-5

我的代码。我都试过(../images和(/图像和他们不工作。

.theme-default .nivoSlider { 
    position:relative; 
    background:#fff url(../images/loading.gif) no-repeat 50% 50%; 
    margin-bottom:10px; 
    -webkit-box-shadow: 0px 1px 5px 0px #4a4a4a; 
    -moz-box-shadow: 0px 1px 5px 0px #4a4a4a; 
    box-shadow: 0px 1px 5px 0px #4a4a4a; 

文件是在/images/loading.gif

+0

您的CSS代码放在哪里?与项目目录结构有关的'/ images'目录在哪里? –

+0

css代码是在public/css/defaul.css – manshu

+0

而'/ images'目录是在哪里? –

回答

0

添加这些链接到页面头部

{!! HTML::style('css/default.css') !!} 

将这些文件复制到/ CSS/JS并将其链接到你的页面:

{!! HTML::script('css/js/jquery.nivo.slider.js') !!} 
{!! HTML::script('css/js/jquery.nivo.slider.pack.js') !!} 

那么这个复制到索引页或视图:

<div id="wrapper"> 
    <div class="slider-wrapper theme-default"> 
    <div id="slider" class="nivoSlider"> 
    <img src="../images/toystory.jpg" data-thumb="../images/toystory.jpg" alt="" /> 
    <a href="http://dev7studios.com"><img src="../images/up.jpg" data-thumb="../images/up.jpg" alt="" title="This is an example of a caption" /></a> 
    <img src="../images/walle.jpg" data-thumb="../images/walle.jpg" alt="" data-transition="slideInLeft" /> 
    <img src="../images/nemo.jpg" data-thumb="../images/nemo.jpg" alt="" title="#htmlcaption" /> 
</div> 
<div id="htmlcaption" class="nivo-html-caption"> 
<strong>This</strong> is an example of a <em>HTML</em> caption with 
<a href="#">a link</a>. </div> 
</div> 
</div> 
<script type="text/javascript"> 
    $(window).load(function() { 
     $('#slider').nivoSlider(); 
    }); 
</script> 

<script type="text/javascript"> 

    var _gaq = _gaq || []; 
    _gaq.push(['_setAccount', 'UA-36251023-1']); 
    _gaq.push(['_setDomainName', 'jqueryscript.net']); 
    _gaq.push(['_trackPageview']); 

(function() { 
     var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 
})(); 

</script> 
+0

nope。没有工作。 – manshu

+0

检查您是否可以在页面上添加该图像的链接,以及是否可以看到图像。然后检查CSS clases是否正确 - .theme-default .nivoSlider – user4621032

+0

是的,它可以通过直接链接访问。 – manshu