非矩形图像 GWT 按钮
我正在尝试基于图像创建自定义 GWT 按钮。
我有一个不是矩形的图像,如下所示:
- 现在,我希望可点击区域仅在图像的可见部分(非透明区域)内工作。这意味着使用按钮的人可以单击图像(按钮)的透明角,但不会触发按钮上的单击事件。无需创建自定义小部件(以及与之相伴的 HTML),这是否可能?
- 我想制作一组这些非矩形按钮,其中会有其他按钮与这个按钮互连(它们的可见边缘将相互碰撞,以一种互锁模式),有点像这样:
这是一个非常复杂的示例,我的示例不会那么大/很多,但概念成立:自定义形状的互锁按钮,每个按钮都是一个单独的按钮。这些按钮不会静态生成,而是根据操作而增长。
这可能吗?我不知道从哪里开始。第二张图片(金字塔互锁三角形)比我想象的更复杂,但这个概念成立。它更复杂的原因是因为最终我只会水平互锁按钮(想想金字塔图片顶部附近的第二行,从左到右的 3 个三角形)。
I am trying to create a custom GWT Button based on an image.
I have an image that is not rectangular, something like this:
- Now, I want the click-able area to only work inside the visible parts of the image (non-transparent areas). This would mean that it's possible for someone using the button to click in the transparent corners of the image (Button) and not trigger the click event on the Button. Is this possible without having to create a custom widget (and the HTML to go with it)?
- I would like to make a set of these non-rectangular buttons, in which there would be other buttons that would inter-connect with this one (their visible edges will bump right up against eachother, in sort of an inter-locking pattern), sort of like this:
That's a very complex example, mine wouldn't be as big/many but the concept holds: inter-locking buttons of custom shape each being an individual button. These buttons would not be generated statically, but grow based on action.
Is this even possible? I have no clue where to begin. The 2nd picture (pyramid inter-locking triangles) is more complex than what I'm envisioning, but the concept holds. The reason it's more complex is because ultimately I would only be inter-locking buttons Horizontally (think of the 2nd row near the top of the pyramid picture, the 3 triangles from left to right).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以为
、
标签创建一个简单的地图小部件。
创建代码:
或者可以将 SVG 图像与 raphaeljs 一起使用以获得更复杂的效果(请参阅raphaelgwt)。它比地图区域解决方案更好。
You can create a simple Map Widget for
<map>
,<area>
tags.The creation code:
or can use SVG image with raphaeljs for more complex effects (see raphaelgwt). It's better than map-area solution.