Java脚本没有在Rails应用程序中执行

时间:2017-06-04 20:50:51

标签: ruby-on-rails

我正在尝试在基本的rails应用程序上添加javascript图像滑块。我将JS文件添加到assets/javascripts文件夹,但我的javascript没有执行。

我在下面添加了我的html文件。任何人都可以告诉我我错过了什么?

<div class="slider">
        <!-- Slideshow 3 -->
        <script>
            // You can also use "$(window).load(function() {"
            $(function () {
              // Slideshow 3
              $("#slider3").responsiveSlides({
                manualControls: '#slider3-pager',
              });
            });
          </script>
        <ul class="rslides" id="slider3">
        <li>
            <div class="banner">
                <h1>What a beautiful bike</h1>
                <h2>timeless, atmospheric<br>& uncredible bikes!</h2>
            </div>
        </li>
        <li>
            <div class="banner banner2">
                <h1>What a beautiful bike</h1>
                <h2>timeless, atmospheric<br>& uncredible bikes!</h2>
            </div>
        </li>
        <li>
            <div class="banner banner1">
                <h1>What a beautiful bike</h1>
                <h2>timeless, atmospheric<br>& uncredible bikes!</h2>
            </div>
        </li>
        </ul>
        <ul id="slider3-pager">
          <li><a href="#"><img src="assets/device3.jpg" alt=""></a></li>
          <li><a href="#"><img src="assets/device2.jpg" alt=""></a></li>
          <li><a href="#"><img src="assets/device1.jpg" alt=""></a></li>
        </ul>
        <div class="clearfix"> </div>
       </div>

0 个答案:

没有答案