jQuery UI 中缺少图标

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19515943/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 00:09:01  来源:igfitidea点击:

Icons missing in jQuery UI

jqueryjquery-ui

提问by PythonEnthusiast

I'm using Modal Formand Widgetsfrom jQuery, but the icons does not appear. for eg the Cross (X)and Plus-Minus (+-)Icons.

我正在使用来自 jQuery 的Modal FormWidgets,但是图标没有出现。例如Cross (X)Plus-Minus (+-)图标。

When I load the page I et these errors.

当我加载页面时,我遇到了这些错误。

"NetworkError: 404 NOT FOUND - http://127.0.0.1:8000/static/css/images/ui-bg_flat_75_ffffff_40x100.png"
ui-bg_...100.png

"NetworkError: 404 NOT FOUND - http://127.0.0.1:8000/static/css/images/ui-icons_222222_256x240.png"
ui-ico...240.png

"NetworkError: 404 NOT FOUND - http://127.0.0.1:8000/static/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png"
ui-bg_...100.png

So, I downloaded the images, put it into the path specified, but then the +- iconsappear twice at the extreme right and moreover only the column1 widgets are minimized. The Close Xicon still not appears. Where I'm going wrong?

因此,我下载了图像,将其放入指定的路径中,但随后+- icons在最右侧出现两次,而且只有 column1 小部件被最小化。在Close X还没有出现图标。我哪里错了?

I would also like to know how to add remove widgets functionality?

我还想知道如何添加删除小部件功能?

回答by BenW

Just download it and save in your network location.

只需下载并保存在您的网络位置即可。

You can get it form the below.

你可以从下面得到它。

https://code.google.com/p/vallalarblogs/downloads/detail?name=ui-bg_flat_75_ffffff_40x100.png&can=2&q=

https://code.google.com/p/vallalarblogs/downloads/detail?name=ui-bg_flat_75_ffffff_40x100.png&can=2&q=

reference: www.thedeveloperblog.com

参考:www.thedeveloperblog.com

回答by Zuks

I have put the images in a convenient zip file: http://zlab.co.za/lib_help/jquery-ui.css.images.zip

我已将图像放在一个方便的 zip 文件中:http: //zlab.co.za/lib_help/jquery-ui.css.images.zip

As the readme.txt file in the zip file reads: Place the "images" folder in the same folder where your "jquery-ui.css" file is located.

正如 zip 文件中的 readme.txt 文件所写:将“images”文件夹放在“j​​query-ui.css”文件所在的同一文件夹中。

I hope this helps :)

我希望这有帮助 :)

回答by klewis

Yeah I had the same problem and it was driving me crazy because I couldn't find the image.

是的,我遇到了同样的问题,它让我发疯,因为我找不到图像。

This may help you out...

这可能会帮助你...

  1. Look for a CSS file in your directories called jquery-ui.css
  2. Open it up and search for ui-bg_flat_75_ffffff_40x100.png.
  1. 在您的目录中查找名为 jquery-ui.css 的 CSS 文件
  2. 打开它并搜索 ui-bg_flat_75_ffffff_40x100.png。

You will then see something like this...

然后你会看到这样的东西......

.ui-widget-content {
    border: 1px solid #aaaaaa;
    background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
    color: #222222;
}

And comment out the background and save the CSS document. Or you can set an absolute path to that background property and see if that works for you. (i.e. background: #ffffff url(http://.../image.png);

并注释掉背景并保存CSS文档。或者您可以设置该背景属性的绝对路径,看看它是否适合您。(即背景:#ffffff url( http://.../image.png);

Hope this helps

希望这可以帮助

回答by ekerner

They arent missing, the path is wrong. Its looking in non-existent dir 'img' for a file that is in dir 'images'.

他们没有丢失,路径是错误的。它在不存在的目录“ img”中查找目录“图像”中的文件。

To fix either edit the file that declares the wrong path or as I did just make a softlink like

要修复要么编辑声明错误路径的文件,要么像我那样做一个软链接

ln -s images img

回答by Alexei

I met a similar error after adding jQuery-ui-tooltip component using bower. It downloads js + css files only, so I had to manually add images.

使用 bower 添加 jQuery-ui-tooltip 组件后,我遇到了类似的错误。它只下载 js + css 文件,所以我不得不手动添加图像。

A good source to find all the images (for all standard themes) is this CDN.

这个CDN是查找所有图像(对于所有标准主题)的一个很好的来源。

回答by CrsCaballero

You need downbload the jQueryUI, this contains de images that you need

您需要下载 jQueryUI,其中包含您需要的图片

enter link description here

在此处输入链接描述

回答by Steve Whitby

Having the right CSS and JS libraries helps, this solved it for me

拥有正确的 CSS 和 JS 库会有所帮助,这为我解决了这个问题

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.12.4.js"></script>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

回答by Anoj

you have workaround by setting background color instead of this missing icon. Here are the steps to follow:

您可以通过设置背景颜色而不是此缺少的图标来解决方法。以下是要遵循的步骤:

  • open relevant 'jquery-ui-x.-.x.css' file
  • search for the missing file name in css file(eg: ui-bg_flat_75_ffffff_40x100.png")
  • Remove/comment the line that calls this background image
  • instead add the following line to replace the background color 'background-color: #ffffff'
  • 打开相关的“jquery-ui-x.-.x.css”文件
  • 在 css 文件中搜索丢失的文件名(例如:ui-bg_flat_75_ffffff_40x100.png”)
  • 删除/注释调用此背景图像的行
  • 而是添加以下行来替换背景颜色 'background-color: #ffffff'

That will probably work

那可能会奏效

回答by dra_red

I found icons were not displaying due to a difference in the casing (ie upper case vs lower case). The CSS file was using "FFFFFF" while the actual file was using "ffffff". Icons displayed for me once I changed the case to match.

我发现图标由于大小写不同(即大写与小写)而未显示。CSS 文件使用“FFFFFF”,而实际文件使用“ffffff”。更改大小写以匹配后,会为我显示图标。