2013-08-26 22 views
1

我正在嘗試在我的項目中使用nanoScroller。我將通過official site的文檔。這是我提出的代碼(nano.js包含與該頁面中提到的production site相同的代碼。但是,它不起作用,並且文本只是溢出容器。有誰能告訴我我做錯了什麼嗎? ?這裏是我的代碼:nanoScroller不工作

<!DOCTYPE html> 
<html> 
    <head> 
     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> 
     </script> 
     <script src="nano.js"> 
     </script> 
     <link rel="stylesheet" href="https://raw.github.com/jamesflorentino/nanoScrollerJS/master/bin/css/nanoscroller.css"> 
     <style> 
      .nano { width: 500px; height: 200px;} 
      .nano .content { padding: 10px; } 
      .nano .pane { background: black; } 
      .nano .slider { background: #111; } 
     </style> 
     <script> 
       $(document).ready(function(){ 
        $(".nano").nanoScroller(); 
       }); 
     </script> 
    </head> 
    <body> 
     <div id="about" class="nano"> 
     <div class="content"> 
      Thanks to SublimeVideo Horizon, the SublimeVideo Modular Player can now easily be enriched with future features and add-ons. Below, we would like to share with you some possible upcoming features and add-ons. We would be delighted if you let us know about any other add-on you may need.Thanks to SublimeVideo Horizon, the SublimeVideo Modular Player can now easily be enriched with future features and add-ons. Below, we would like to share with you some possible upcoming features and add-ons. We would be delighted if you let us know about any other add-on you may need.Thanks to SublimeVideo Horizon, the SublimeVideo Modular Player can now easily be enriched with future features and add-ons. Below, we would like to share with you some possible upcoming features and add-ons. We would be delighted if you let us know about any other add-on you may need.Thanks to SublimeVideo Horizon, the SublimeVideo Modular Player can now easily be enriched with future features and add-ons. Below, we would like to share with you some possible upcoming features and add-ons. We would be delighted if you let us know about any other add-on you may need.Thanks to SublimeVideo Horizon, t 
     </div> 
     </div> 
    </body> 
</html> 
+0

在控制檯中的任何錯誤也? ,我不確定'raw.github.com'允許直接訪問代碼 – Brewal

+0

所以你說我將'css'也複製到一個單獨的文件中?好吧,這樣做。並且不,在控制檯中沒有錯誤。 – SexyBeast

+0

哎,它的工作原理! 'css'文件沒有被訪問..但是在Firefox中,當我查看源代碼時,'github'鏈接被正確突出顯示爲外部鏈接,並且點擊它顯示頁面。爲什麼不能訪問它? – SexyBeast

回答

1

row.github.com不是一個CDN,因此不能夠從其他網站遠程訪問,下載CSS文件到您的服務器和改變你的<link rel="stylesheet" />所以