- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
在万维网上。 www.coachella.com他们有这些穿梭巴士图标,其中 3 个,并且在悬停时图标会四处移动。我怎样才能为我的网站做这样的事情?有没有指南?
我查看了源代码,它非常困惑,但看起来它们有 3 个 svg 标签,并且它们在悬停时是动画的。普通人的工作有多难?
<div id="icon-shuttles" class="icon">
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="icon-shuttles-base-1" class="absolutePosition" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 305.8 350.7" style="transform-origin: 100% 50% 0px; transform: matrix(1, 0, 0, 1, 0, 0);" xml:space="preserve">
<style type="text/css">
.st0-shuttles{fill:#FCFCFC;}
.st1-shuttles{fill:#FCA126;}
.st2-shuttles{fill:#CB821F;}
</style>
<rect x="25.6" y="50" class="st0-shuttles" width="255" height="154.5"></rect>
<path class="st1-shuttles" d="M28.3,154.5c0.4-15.2,0.8-30.3,1.2-45.4c0.1-2.5,0.1-5.1,0.2-7.6C30,91.3,30.4,81.2,30.5,71
c0-7.4,6.4-10.6,13.9-12.1c6.8-1.3,14.5-1.2,19.1-1.4c12.7-0.6,25.4-0.8,38.1-1.1c17-0.3,34.1-0.4,51.4-0.4V35.3h-24.1
c-5.5,0-10-4.5-10-10V25c0-5.5,4.5-10,10-10H153V0H37C20.5,0,7,13.5,7,30L6.2,56.7L4.9,99.9L1.7,209.3l-1,32.8l-0.3,8.8l-0.3,10.9
L0,265.4c0,7.2,2.6,15.7,6.8,23c0.8,1.4,1.7,2.7,2.6,4c1.5,2,3,3.9,4.7,5.5c0.2,0.2,0.3,0.3,0.5,0.5v44.1c0,4.4,3.6,8,8,8h40
c4.4,0,8-3.6,8-8v-23.2h82.2v-14v-35.2l0,0v-67.6c-8.1,0-16.1-0.1-24.2-0.2c-15.6-0.2-31.2-0.3-46.7-1.2c-7.1-0.4-14.1-0.9-21.1-1.7
c-5.4-0.7-10.9-1.5-16.3-2.7c-1.1-0.2-2.2-0.5-3.3-0.8c-2.8-0.8-5.5-1.9-7.8-3.6c-6.8-4.9-5.9-12.5-5.7-20
C28,166.5,28.1,160.5,28.3,154.5z"></path>
<path class="st2-shuttles" d="M277.6,154.5c-0.4-15.2-0.8-30.3-1.2-45.4c-0.1-2.5-0.1-5.1-0.2-7.6c-0.3-10.2-0.7-20.3-0.8-30.5
c0-7.4-6.4-10.6-13.9-12.1c-6.8-1.3-14.5-1.2-19.1-1.4c-12.7-0.6-25.4-0.8-38.1-1.1c-17-0.3-34.1-0.4-51.4-0.4V35.3H177
c5.5,0,10-4.5,10-10V25c0-5.5-4.5-10-10-10h-24.1V0h115.9c16.5,0,30,13.5,30,30l0.8,26.7l1.3,43.2l3.2,109.4l1,32.8l0.3,8.8
l0.3,10.9l0.1,3.6c0,7.2-2.6,15.7-6.8,23c-0.8,1.4-1.7,2.7-2.6,4c-1.5,2-3,3.9-4.7,5.5c-0.2,0.2-0.3,0.3-0.5,0.5v44.1
c0,4.4-3.6,8-8,8h-40c-4.4,0-8-3.6-8-8v-23.2H153v-14v-35.2l0,0v-67.6c8.1,0,16.1-0.1,24.2-0.2c15.6-0.2,31.2-0.3,46.7-1.2
c7.1-0.4,14.1-0.9,21.1-1.7c5.4-0.7,10.9-1.5,16.3-2.7c1.1-0.2,2.2-0.5,3.3-0.8c2.8-0.8,5.5-1.9,7.8-3.6c6.8-4.9,5.9-12.5,5.7-20
C277.9,166.5,277.7,160.5,277.6,154.5z"></path>
<circle class="st0-shuttles" cx="55.6" cy="251" r="26.5"></circle>
<circle class="st0-shuttles" cx="250.6" cy="251" r="26.5"></circle>
</svg>
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="icon-shuttles-base-3" class="absolutePosition" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 305.8 350.7" style="transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: 0% 50% 0px;" xml:space="preserve">
<style type="text/css">
.st0-shuttles{fill:#FCFCFC;}
.st1-shuttles{fill:#FCA126;}
.st2-shuttles{fill:#CB821F;}
</style>
<rect x="25.6" y="50" class="st0-shuttles" width="255" height="154.5"></rect>
<path class="st1-shuttles" d="M28.3,154.5c0.4-15.2,0.8-30.3,1.2-45.4c0.1-2.5,0.1-5.1,0.2-7.6C30,91.3,30.4,81.2,30.5,71
c0-7.4,6.4-10.6,13.9-12.1c6.8-1.3,14.5-1.2,19.1-1.4c12.7-0.6,25.4-0.8,38.1-1.1c17-0.3,34.1-0.4,51.4-0.4V35.3h-24.1
c-5.5,0-10-4.5-10-10V25c0-5.5,4.5-10,10-10H153V0H37C20.5,0,7,13.5,7,30L6.2,56.7L4.9,99.9L1.7,209.3l-1,32.8l-0.3,8.8l-0.3,10.9
L0,265.4c0,7.2,2.6,15.7,6.8,23c0.8,1.4,1.7,2.7,2.6,4c1.5,2,3,3.9,4.7,5.5c0.2,0.2,0.3,0.3,0.5,0.5v44.1c0,4.4,3.6,8,8,8h40
c4.4,0,8-3.6,8-8v-23.2h82.2v-14v-35.2l0,0v-67.6c-8.1,0-16.1-0.1-24.2-0.2c-15.6-0.2-31.2-0.3-46.7-1.2c-7.1-0.4-14.1-0.9-21.1-1.7
c-5.4-0.7-10.9-1.5-16.3-2.7c-1.1-0.2-2.2-0.5-3.3-0.8c-2.8-0.8-5.5-1.9-7.8-3.6c-6.8-4.9-5.9-12.5-5.7-20
C28,166.5,28.1,160.5,28.3,154.5z"></path>
<path class="st2-shuttles" d="M277.6,154.5c-0.4-15.2-0.8-30.3-1.2-45.4c-0.1-2.5-0.1-5.1-0.2-7.6c-0.3-10.2-0.7-20.3-0.8-30.5
c0-7.4-6.4-10.6-13.9-12.1c-6.8-1.3-14.5-1.2-19.1-1.4c-12.7-0.6-25.4-0.8-38.1-1.1c-17-0.3-34.1-0.4-51.4-0.4V35.3H177
c5.5,0,10-4.5,10-10V25c0-5.5-4.5-10-10-10h-24.1V0h115.9c16.5,0,30,13.5,30,30l0.8,26.7l1.3,43.2l3.2,109.4l1,32.8l0.3,8.8
l0.3,10.9l0.1,3.6c0,7.2-2.6,15.7-6.8,23c-0.8,1.4-1.7,2.7-2.6,4c-1.5,2-3,3.9-4.7,5.5c-0.2,0.2-0.3,0.3-0.5,0.5v44.1
c0,4.4-3.6,8-8,8h-40c-4.4,0-8-3.6-8-8v-23.2H153v-14v-35.2l0,0v-67.6c8.1,0,16.1-0.1,24.2-0.2c15.6-0.2,31.2-0.3,46.7-1.2
c7.1-0.4,14.1-0.9,21.1-1.7c5.4-0.7,10.9-1.5,16.3-2.7c1.1-0.2,2.2-0.5,3.3-0.8c2.8-0.8,5.5-1.9,7.8-3.6c6.8-4.9,5.9-12.5,5.7-20
C277.9,166.5,277.7,160.5,277.6,154.5z"></path>
<circle class="st0-shuttles" cx="55.6" cy="251" r="26.5"></circle>
<circle class="st0-shuttles" cx="250.6" cy="251" r="26.5"></circle>
</svg>
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="icon-shuttles-base-2" class="absolutePosition" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 305.8 350.7" style="enable-background:new 0 0 305.8 350.7;" xml:space="preserve">
<style type="text/css">
.st0-shuttles{fill:#FCFCFC;}
.st1-shuttles{fill:#FCA126;}
.st2-shuttles{fill:#CB821F;}
</style>
<rect x="25.6" y="50" class="st0-shuttles" width="255" height="154.5"></rect>
<path class="st1-shuttles" d="M28.3,154.5c0.4-15.2,0.8-30.3,1.2-45.4c0.1-2.5,0.1-5.1,0.2-7.6C30,91.3,30.4,81.2,30.5,71
c0-7.4,6.4-10.6,13.9-12.1c6.8-1.3,14.5-1.2,19.1-1.4c12.7-0.6,25.4-0.8,38.1-1.1c17-0.3,34.1-0.4,51.4-0.4V35.3h-24.1
c-5.5,0-10-4.5-10-10V25c0-5.5,4.5-10,10-10H153V0H37C20.5,0,7,13.5,7,30L6.2,56.7L4.9,99.9L1.7,209.3l-1,32.8l-0.3,8.8l-0.3,10.9
L0,265.4c0,7.2,2.6,15.7,6.8,23c0.8,1.4,1.7,2.7,2.6,4c1.5,2,3,3.9,4.7,5.5c0.2,0.2,0.3,0.3,0.5,0.5v44.1c0,4.4,3.6,8,8,8h40
c4.4,0,8-3.6,8-8v-23.2h82.2v-14v-35.2l0,0v-67.6c-8.1,0-16.1-0.1-24.2-0.2c-15.6-0.2-31.2-0.3-46.7-1.2c-7.1-0.4-14.1-0.9-21.1-1.7
c-5.4-0.7-10.9-1.5-16.3-2.7c-1.1-0.2-2.2-0.5-3.3-0.8c-2.8-0.8-5.5-1.9-7.8-3.6c-6.8-4.9-5.9-12.5-5.7-20
C28,166.5,28.1,160.5,28.3,154.5z"></path>
<path class="st2-shuttles" d="M277.6,154.5c-0.4-15.2-0.8-30.3-1.2-45.4c-0.1-2.5-0.1-5.1-0.2-7.6c-0.3-10.2-0.7-20.3-0.8-30.5
c0-7.4-6.4-10.6-13.9-12.1c-6.8-1.3-14.5-1.2-19.1-1.4c-12.7-0.6-25.4-0.8-38.1-1.1c-17-0.3-34.1-0.4-51.4-0.4V35.3H177
c5.5,0,10-4.5,10-10V25c0-5.5-4.5-10-10-10h-24.1V0h115.9c16.5,0,30,13.5,30,30l0.8,26.7l1.3,43.2l3.2,109.4l1,32.8l0.3,8.8
l0.3,10.9l0.1,3.6c0,7.2-2.6,15.7-6.8,23c-0.8,1.4-1.7,2.7-2.6,4c-1.5,2-3,3.9-4.7,5.5c-0.2,0.2-0.3,0.3-0.5,0.5v44.1
c0,4.4-3.6,8-8,8h-40c-4.4,0-8-3.6-8-8v-23.2H153v-14v-35.2l0,0v-67.6c8.1,0,16.1-0.1,24.2-0.2c15.6-0.2,31.2-0.3,46.7-1.2
c7.1-0.4,14.1-0.9,21.1-1.7c5.4-0.7,10.9-1.5,16.3-2.7c1.1-0.2,2.2-0.5,3.3-0.8c2.8-0.8,5.5-1.9,7.8-3.6c6.8-4.9,5.9-12.5,5.7-20
C277.9,166.5,277.7,160.5,277.6,154.5z"></path>
<circle class="st0-shuttles" cx="55.6" cy="251" r="26.5"></circle>
<circle class="st0-shuttles" cx="250.6" cy="251" r="26.5"></circle>
</svg>
<div id="icon-shuttles-hit" class="icon-hit-square"></div>
</div>
最佳答案
如果您不熟悉 SVG,您可以将它们换成标准的 png 图标。可以找到有关 SVG 的一些信息 here
动画部分很简单,只需将 transform:translate3D
添加到悬停的两个公交车图标即可。
假设您有一个包含 3 个 div 的 div。每个 div 包含一个总线(可以是 svg、png、图标字体或类似的)
HTML
<div class="buses">
<div class="bus-1"></div>
<div class="bus-2"></div>
<div class="bus-3"></div>
</div>
您的 CSS 看起来像下面这样:
CSS
.buses .bus-1,
.buses .bus-3 {
/* This determines the duration of the animation */
-webkit-transition: -webkit-transform 600ms ease;
transition: transform 600ms ease;
}
.buses:hover .bus-1 {
/* The translate property will move the bus in an x,y,z direction */
-webkit-transform: translate3D(-10px, 0, 0);
transform: translate3D(-10px, 0, 0);
}
.buses:hover .bus-3 {
/* The translate property will move the bus in an x,y,z direction */
-webkit-transform: translate3D(10px, 0, 0);
transform: translate3D(10px, 0, 0);
}
关于html - 这个网站如何让他们的巴士图标在悬停时移动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35565942/
我正在学习和使用 jQuery,并且想要显示某些元素的删除图标。 我有一个外部主 div,其中包含许多元素的包装器。在元素包装器内部,我想当用户将鼠标悬停在元素包装器上时显示删除图标,并在用户移出元素
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
我从 Qt 开始,每当有人将鼠标悬停在 QPushButton 上时,我想将 QPushButton 设置为不同的图标。到目前为止,这是我的代码: #include QPushButton *but
我从 Qt 开始,我想在有人将鼠标悬停在 QPushButton 上时将其设置为不同的图标。到目前为止,这是我的代码: #include QPushButton *button = new QPus
我有以下代码... jQuery(function($) { var timer; $('.action-viewer').hide(); $('.task').on('mouseover
我有一张照片,当用户将鼠标悬停在它上面时,我会在照片顶部显示(使用绝对定位)2 个箭头,一个用于进入上一张照片,一个用于进入下一张照片。这是到目前为止的代码... $('a.large_product
$('li > a').hover( function(){ $(this).animate({ backgroundColor: '#2a639a', color: '#fff'
我有一个悬停事件附加到几个链接,当您点击它时,会出现一个框。 有没有一种方法可以让悬停事件仅在鼠标悬停在链接上超过 500 毫秒时触发?因此,目前只要鼠标移到链接上,就会出现该框,但我希望只有当鼠标悬
我正在创建包含各种样式控件的演示应用程序。它允许我快速预览更改。 我的问题是下面的代码不起作用: Pressed button 它表示 IsPressed 的 setter 受到保护。我明白了,但我需
我正在尝试使用 js 并创建带有一些“信息文本”的“描述框” HTML google JS function info() {} 我不知道是哪个代码用一些文本创建了所谓的“描
我有一个 Accordion 风格的菜单,在悬停状态下工作正常,但我想改为点击... $(document).ready(function(){ $('#nav > li').hover(
我正在使用 Chartjs v.1.0.2 并尝试将点设置为仅在悬停在当前点上时出现。同样的问题是当我使用悬停或鼠标悬停时。可以使用 getPointsAtEvent(e); 找到当前点,但它仅在我将
我使用foreach 语句访问IEnumerable 的所有元素并将其呈现在详细信息页面中。我想让每个元素的悬停属性只影响一个元素。所以我使用 jQuery 单独影响每个元素 但是当我运行代码并将鼠标
首先提前感谢您的帮助。 案例:我在一行中有多个 div。这些 div 位于一个框中,我可以在此框中水平滚动以查看其他 div。我制作了两个按钮(L 表示左侧,R 表示右侧),以便在悬停或单击这些按钮时
我正在创建一个应用外观页面。 我希望在鼠标悬停时打开底部菜单上的其中一个按钮。 这感觉像是一项简单的任务,但我所做的一切似乎都不起作用。我错过了什么,我做了很多研究,但似乎找不到解决方案。 我尝试使用
我遇到的问题是,当您将鼠标悬停在按钮上时,只有按钮的某些部分会触发悬停/可点击状态,而不是所有实际 block 。有什么想法吗? 这是使用它的站点:http://www.revival.tv/turn
我有一位客户想要在他们的网站上实现特定功能,但我有点困惑如何做到这一点。 基本上,如果你查看他们的 existing site您可以看到 4 个圆形按钮。 他们想要的是,当有人将鼠标悬停(或单击,如果
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 关闭 9 年前。 关于您编写的代码问题的问题必须在问题本身中描述具体问题 — 并且包括有效代码 以
我目前正在编写我的第一个响应式网站(总的来说我是一个初学者)并且我遇到了很多障碍。其中之一是我的菜单有问题。我会尽量具体。我有一个用于桌面的水平菜单和一个用于平板电脑/手机的垂直菜单。我不知道如何解决
我正在为网站创建菜单。我正试图在链接上实现悬停 和点击 效果。我希望列表元素 a 上的悬停事件触发彩色动画并添加“事件”类。如果触发了点击和悬停事件,我想为该元素分配相同的类。问题是,一旦元素未悬停并
我是一名优秀的程序员,十分优秀!