- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以我在 gwt 中有一个程序,它在右侧列出了几个图像,将鼠标悬停在其中一个图像上时,一些附加信息会显示在左侧的自定义小部件中,包括图像的一部分和特殊背景,其中是更大背景图像本身的一部分,对于取决于图像的小部件。
到目前为止,一切正常,两个图像基本上都正确显示。然而,背景图像在左上角有“损坏的图像”图标,即使它显示完美,并且每当我将鼠标悬停在右侧的另一个图像上时也会更新。但真正重要的是,我悬停在其上的图像部分仅在加载背景图像之前显示一瞬间,因为背景图像将覆盖其他图像。忽略背景会导致图像的一部分正常显示,但也会出现“损坏的图像”图标。不在两个图像上使用 setVisibleRect() 可以让一切正常工作,但显示的图像当然是错误的。到目前为止,这是我来自自定义小部件的代码,用于显示悬停在其上的图像的所需部分:
public void setBild(Image bild) {
this.bild.setUrl(bild.getUrl());
this.bild.setVisibleRect(38,61,134,94);
this.bild.getElement().getStyle().setZIndex(2);
}
其中 this.bild 是我的自定义小部件中的图像。
此外,在根据我所掌握的一些信息获取背景的方法中:
if(!hintergrund.isAttached()){
this.add(hintergrund);
this.setWidgetLeftWidth(hintergrund, 0, Unit.PX, 230, Unit.PX);
this.setWidgetTopHeight(hintergrund, 0, Unit.PX, 650, Unit.PX);
}
if(k.getFarbe().equals("rot")) hintergrund.setVisibleRect(460, 0, 230, 650);
if(k.getFarbe().equals("hell")) hintergrund.setVisibleRect(230, 0, 230, 650);
if(k.getFarbe().equals("braun")) hintergrund.setVisibleRect(0, 0, 230, 650);
if(k.getFarbe().equals("grun")) hintergrund.setVisibleRect(0, 650, 230, 650);
if(k.getFarbe().equals("grau")) hintergrund.setVisibleRect(230, 650, 230, 650);
if(k.getFarbe().equals("lila;braun")) hintergrund.setVisibleRect(460, 650, 230, 650);
hintergrund.getElement().getStyle().setZIndex(1);
其中hintergrund是背景图像。
当我将鼠标悬停在图像上时,我的编译器会向我发送消息
[WARN] 404 - GET /labyrinthweb/clear.cache.gif (127.0.0.1) 1393 bytes
Request headers
Host: 127.0.0.1:8888
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:46.0) Gecko/20100101 Firefox/46.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://127.0.0.1:8888/LabyrinthWeb.html
Cookie: optionen=310; JSESSIONID=vyr356eyxfph1lzazwqw8rkn8
Connection: keep-alive
Response headers
Content-Type: text/html;charset=ISO-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 1393
我也声明了
<script type="text/javascript" language="javascript"
src="labyrinthweb/labyrinthweb.nocache.js"></script>
在我的 html 文件中,并将我的模块重命名为 *.gwt.xml 文件中的 labyrinthweb。
有人可以帮我吗?
最佳答案
这就是 Image
小部件的工作原理:它的 url
属性指向默认的 1x1 像素透明 gif。为了能够进行图像裁剪(和其他操作),真实图像将显示为小部件的背景。通过这种方式很容易做到setVisibleRect
,小部件只需设置background-position
属性并改变大小。
您的问题是您错过了默认的透明 gif clear.cache.gif
:
[WARN] 404 - GET /labyrinthweb/clear.cache.gif (127.0.0.1) 1393 bytes
这就是为什么您会在图像顶部看到图像损坏
图标。
clear.cache.gif
应位于 war\module_name
文件夹中,并在每次编译项目时复制到此处。因此,您应该尝试以下操作:
clear.cache.gif
是否位于 war\module_name
文件夹我希望这会有所帮助。
关于javascript - SetVisibleRect 使图像困惑(gwt),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37491285/
我想知道 GWT、GWT-RPC、EXT-GWT 和 Smart GWT 之间的区别。目前,我设法借了有关 GWT 的书籍,据我所知,它只是一个旨在促进快速高效的 Ajax(异步 JavaScript
不,这不是问如何让 Guava 在 GWT 中工作,因为我已经让它工作了。 我的问题是,当我执行继承时 我希望在命名空间 com.google.common.collect 中找到一个文件 Coll
Ext GWT 和 GWT-Ext 之间有区别吗?因为我在浏览 Ext GWT 时看到了这个页面 http://gwt-ext.com/demo/ .有什么帮助吗? 最佳答案 ExtGWT 由开发 E
调查gwt-dispatch之后和 Google Wave I/O presentation (Best practices) ( video here ),我想知道为什么官方 GWT 版本 (2.0
我在我的应用程序中使用带有 ext 的 GWT 2.0.3。该项目不再处于积极开发状态并且已被 Smart GWT 取代。我正在为此应用程序使用 HMVC 模式。现在使用现有的 GWT 2.0.3 和
当我尝试在 Windows Vista 上为 ie 8 使用 GWT 开发模式插件时,我不断看到安装插件的提示。 运行插件后我仍然总是看到这个页面。有谁知道如何解决这样的问题? 最佳答案 看这个:Ca
我正在尝试对 GWT RPC 序列化策略进行一些背景阅读,发现 GWT 在编译后将 *.gwt.rpc 文件中的可序列化类型列入白名单。 以下是我的应用程序中生成的一个此类 .gwt.rpc 文件的摘
如果 Enum 实现了 java.io.Serializable,我无法将它序列化为 GWT。它会成功编译 GWT,但在运行时,我会感到害怕: Type 'com....security..Admin
是否有可以与 GWT 一起使用的进度条小部件,还是必须自己制作?我尝试在 google-web-toolkit-incubator、gwtupload 和 upload4gwt 中使用进度条,但没有任
由于 Javadoc 没有说明使用 com.google.gwt.core.shared.GWT 的原因,它似乎包含 com.google.gwt.core.client.GWT 的功能子集,前者存在
我必须在 gwt 中创建一个图像按钮,它使用三个图像(左侧图像、中心拉伸(stretch)图像和右侧图像)。左侧图像和右侧图像具有圆角。中心图像想要拉伸(stretch)取决于按钮标题大小.创建的 I
我正在尝试在 GWT 的垂直面板中设置 align 属性,如下所示: vpanel = new VerticalPanel(); vPanel.setHorizontalAlignment(HasHo
我想在 GWT 中添加可编辑的组合框,请告诉我解决方案? 最佳答案 试试 Advanced GWT Components , 具体来说 org.gwt.advanced.client.ui.widge
我在使用 GWT Designer 配置 GXT 时遇到问题。我拥有 Eclipse、GWT 插件和 GXT 的所有新版本,但无法将 GXT 配置为与 GWT Designer 一起使用。我设置了我的
我们有一个当前使用 Capistrano 部署的应用程序。该应用程序使用 php 作为后端,使用 GWT 作为前端。 我已经设法通过 Ant 文件编译 GWT,但想用自定义 Capistrano 任务
这应该很简单,但不知何故我找不到在 GWT 中创建简单超链接的方法。基本上,我想在用户点击某些东西时加载另一个页面。 Hyperlink似乎仅指向内部 GWT 应用程序状态。我想我可以把链接放在 HT
在 GWT 界面中哪个更好,使用带有 javacode 的普通 MVP,还是 UiBinder?从性能、编辑、简单性方面。 最佳答案 这就是Google says : Besides being a
GWT 2.5.0 开发模式 我在下面对文件上传做了一个简单的测试, startupUrl: http://127.0.0.1:8888/UploadTest.html?gwt.codesvr=127
我需要创建一个SuggestBox,在按下时将显示所有选项 Enter键。 我已经写了以下实现,看来是 工作正常。 我希望有人审查我的实现情况,并让我知道 在任何特定情况下都会引起问题。 另外,要传递
在哪里可以找到有关 GWT 和 GWT-Ext 延迟加载的更多信息? 最佳答案 快速谷歌搜索显示 nice blog entry由 GWT 团队提供。 关于 GWT-Ext,我无话可说,但无论采用何种
我是一名优秀的程序员,十分优秀!