2015-07-20 39 views
0

這對於某人來說很簡單,但我幾乎甚至不是JavaScript的初學者; (我試過谷歌搜索這個) 我試圖從http://responsiveimg.com/工作得到響應圖。下面的代碼總是會在桌面和手機瀏覽器中加載全尺寸的7.8 MB測試圖像。我沒有看到新創建的小圖像,正如我在文件夾中預期的那樣。無法獲得響應圖像jQuery插件工作

<!doctype html> 
<html> 
<head> 
<meta charset="utf-8"> 

<script src="js/responsiveImg.js"></script> 

<script type="text/javascript"> 
{ 
    $("#img1").responsiveImg(); 
} 
</script> 

<title>Test Document</title> 
</head> 

<body> 
<h1>Test of responsive images program. #6</h1> 

    <div style="width:100%;"> 
     <img id="img1" src="IMG_0176.jpg" style="max-width:100%;" alt="BIG IMAGE"> 
    </div> 

</body> 
</html> 

中的test.html文件,圖像和文件夾的JS都在同一個目錄中,子目錄我/的public_html/
我懷疑我不是進入$(「#IMG1」)。 responsiveImg();正確。

+0

檢查控制檯錯誤。你的'