gpt4 book ai didi

javascript - jPicker - 损坏的图像

转载 作者:行者123 更新时间:2023-11-30 18:27:10 24 4
gpt4 key购买 nike

我正在使用 Django 和 jquery,实现 jPicker http://www.digitalmagicpro.com/jPicker/在我的网络应用程序中。在这里,我在 jPicker 彩色显示器上看到了损坏的图像。当我检查服务器代码时,它显示如下

"GET /files/css/jPicker-1.1.6.min.css HTTP/1.1" 304 0
"GET /files/css/jPicker.css HTTP/1.1" 304 0
"GET /files/js/jquery-1.7.1.min.js HTTP/1.1" 304 0
"GET /files/js/jpicker-1.1.6.min.js HTTP/1.1" 304 0
"GET /jPicker/images/mappoint.gif HTTP/1.1" 404 3209
"GET /jPicker/images/rangearrows.gif HTTP/1.1" 404 3218
"GET /jPicker/images/Maps.png HTTP/1.1" 404 3197
"GET /jPicker/images/map-opacity.png HTTP/1.1" 404 3218
"GET /jPicker/images/Bars.png HTTP/1.1" 404 3197
"GET /jPicker/images/bar-opacity.png HTTP/1.1" 404 3218
"GET /jPicker/images/AlphaBar.png HTTP/1.1" 404 3209
"GET /jPicker/images/preview-opacity.png HTTP/1.1" 404 3230
"GET /jPicker/images/NoColor.png HTTP/1.1" 404 3206

在那里找不到显示 404 的图像文件,但我正确链接了 css 文件夹内的 images 文件夹。

/home/nirmal/try/files/css/images/
/home/nirmal/try/files/css/jPicker.css
/home/nirmal/try/files/css/jPicker-1.1.6.min.css
/home/nirmal/try/files/js/jquery-1.7.1.min.js
/home/nirmal/try/files/js/jpicker-1.1.6.min.js

我的 Django 设置是

MEDIA_ROOT = '/home/nirmal/try/files/'
MEDIA_URL = 'http://localhost:8000/files/'

我犯了什么错误导致图片出现在 jPicker/images 上却找不到?

谢谢!

最佳答案

jPicker 有一个默认变量,说明图像文件夹所在的位置:

 $.fn.jPicker.defaults = /* jPicker defaults - you can change anything in this section (such as the clientPath to your images) without fear of breaking the program */
{
images:
{
clientPath: '/jPicker/images/', /* Path to image files */
}
}

您应该将此默认值覆盖为 images.clientPath = '/files/css/images/',例如:

<script type="text/javascript">        
$(document).ready(
function()
{
$('#your-element').jPicker({images:{clientPath: '/files/css/images/'}});
});
</script>

另请参阅 http://www.digitalmagicpro.com/jPicker/ 的“设置”部分(糟糕的是我无法链接到确切的位置,但 Ctrl + F 是你的 friend )。

祝你好运,好吧

关于javascript - jPicker - 损坏的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10548619/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com