- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个网站,我想在这里有一些带有链接的游戏的标志。即使在悬停时更改图像大小,我也完成了这一切。我需要的是单击该链接后尺寸保持更大。那可能吗?找不到任何简单的东西。只有一些用于背景颜色的 jQuery 和 javascript 代码。这是代码:
<table id="containerlogos" style="width: 1200px; height: 150px;">
<tr>
<td id="pkmn"><a href="http://www.pkmnpro.cz"></a></td>
<td id="ygo"><a href="http://www.ygopro.cz"></a>
</td>
<td id="mtg"><a href="http://www.mtgpro.cz"></a>
</td>
<td id="hs"><a href="http://www.svet-karet.cz/?page_id=7"></a></td>
</tr>
</table>
和CSS:
#containerlogos {
position: relative;
z-index: 3;
}
#pkmn {
background: url("http://www.svet-karet.cz/img/pkmn.png") no-repeat top;
width: 150px;
height: 100px;
background-size: auto 60px;
float: left;
padding-left: 20px;
}
#pkmn:hover {
animation: pkmn 0.115s linear;
-webkit-animation: pkmn 0.115s linear;
background-size: auto 80px;
position: relative;
}
#pkmn a {
display: block;
height: 80px;
width: auto;
}
/*YGO logo*/
#ygo {
background: url("http://www.svet-karet.cz/img/ygo.png") no-repeat top;
width: 200px;
height: 100px;
background-size: auto 60px;
float: left;
position:relative;
margin-right: 20px;
}
#ygo:hover {
animation: ygo 0.115s linear;
-webkit-animation: ygo 0.115s linear;
background-size: auto 80px;
position: relative;
}
#ygo a {
display: block;
height: 100px;
width: auto;
}
/*mtg logo*/
#mtg {
background: url("http://www.zdenekriha.eu/img/mtg.png") no-repeat top center;
width: 215px;
height: 100px;
background-size: auto 40px;
float: left;
position: relative;
margin-left: -50px;
top: 10px;
}
#mtg:hover {
animation: mtg 0.115s linear;
-webkit-animation: mtg 0.115s linear;
background-size: auto 60px;
position: relative;
}
#mtg a {
display: block;
height: 80px;
width: auto;
}
/*HS LOGO*/
#hs {
background: url("http://www.zdenekriha.eu/img/hs.png") no-repeat top;
width: 280px;
height: 150px;
background-size: auto 80px;
float: left;
position: relative;
margin-left: -25px;
top:-12px;
}
#hs:hover {
animation: hs 0.115s linear;
-webkit-animation: hs 0.115s linear;
background-size: auto 100px;
position: relative;
}
#hs a {
display: block;
height: 80px;
width: auto;
}
@-webkit-keyframes pkmn {
0% {
background-size: auto 60px;
position: relative;
}
25% {
background-size: auto 65px;
position: relative;
}
50% {
background-size: auto 70px;
position: relative;
}
75% {
background-size: auto 75px;
position: relative;
}
99% {
background-size: auto 80px;
position: relative;
}
100% {
background-size: auto 80px;
position: relative;
-webkit-animation-play-state:paused;
}
}
@-webkit-keyframes ygo {
0% {
background-size: auto 60px;
position: relative;
}
25% {
background-size: auto 65px;
position: relative;
}
50% {
background-size: auto 70px;
position: relative;
}
75% {
background-size: auto 75px;
position: relative;
}
99% {
background-size: auto 80px;
position: relative;
}
100% {
background-size: auto 80px;
position: relative;
-webkit-animation-play-state:paused;
}
}
@-webkit-keyframes mtg {
0% {
background-size: auto 40px;
position: relative;
}
25% {
background-size: auto 45px;
position: relative;
}
50% {
background-size: auto 50px;
position: relative;
}
75% {
background-size: auto 55px;
position: relative;
}
99% {
background-size: auto 60px;
position: relative;
}
100% {
background-size: auto 60px;
position: relative;
-webkit-animation-play-state:paused;
}
}
@-webkit-keyframes hs {
0% {
background-size: auto 80px;
position: relative;
}
25% {
background-size: auto 85px;
position: relative;
}
50% {
background-size: auto 90px;
position: relative;
}
75% {
background-size: auto 95px;
position: relative;
}
99% {
background-size: auto 100px;
position: relative;
}
100% {
background-size: auto 100px;
position: relative;
-webkit-animation-play-state:paused;
}
}
最佳答案
试试这个:
$('#containerlogos a').on('click', function (event) {
event.preventDefault();
$(this).closest('td').css('background-size','auto 80px');
});
关于javascript - 单击链接后需要更改 td 的背景图像大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21079724/
我正在用一个 TD 和一个 colspan 属性替换多个 TD。 然而,这呈现完全不同。 我不明白为什么 不同于 我的问题是前 2 个 TD 的宽度之和与 colspanned TD 的宽度不同。
我想这是个愚蠢的问题,但我是 json 的新手,所以任何答案都会有所帮助。 我有 json 文件: `{"aaData": [ [1, "70.1700", "2008-12-29 11:23:00"
我有一个类似 html 的网页格式如下: .... . . . alo foo bla bla 现在,我只知道值 bla bla , 根据该值我们可以跟踪或找到 3rd
我有以下 html 代码: Add New Item test test test test test test test te
Name1 Position1 Operation1 Name2 Position2
如果其中的数据与同一行上第三列 td 内的数据匹配,我需要做的是向第一列 td 添加一个类。 http://jsfiddle.net/rUssu/ html 表格 firstsecondthi
有什么方法可以清除或隐藏第一个 td 的内容,从双列表中的第二个 td,而无需对实际 td 的任何编辑权限? 所以我想隐藏下表中的数字 1. Content
当第一个高度大于第二个 , 包含第二个文本 与中心对齐。我想要第二个 的文本或元素当第一个 对齐到左上角的高度大于秒。 我如何使用 css 来做到这一点? ? HTML5, CSS3 an
我这里遇到了一些麻烦。我正在开发一个按钮,一旦选择该按钮将运行 JavaScript 函数 - ShowColumn() - 这将使表格列出现。表格列首先将被隐藏 - “display:none;”
我需要将第一个 td 设为 100% 宽(包括图像)并将其他 td 放在第一个 td 下方。如何在不更改 HTML 的情况下执行此操作? 这是我的: #katalogas { float:left;
用于创建规则列表的Java类 public class CompArray { public ArrayList a1= new ArrayList(); public CompArray (){
我想在悬停在特定 td 上时更改特定 td 之前所有 td 的背景颜色。 因此,当我将鼠标悬停在该图标上时,该特定行中它之前的所有图标和文本都会更改它们的背景。 任何人都可以建议如何实现它。 这是我的
我今天花了一些时间查看使用 JQuery 遍历表及其行的示例,经过大量试验后我能够做到这一点。但是我在尝试从 td 元素获取值时遇到问题,因此我可以更改为另一个 td 元素的颜色。我有一个绑定(bin
这个问题在这里已经有了答案: Is there a "previous sibling" selector? (32 个答案) 关闭 7 年前。 我正在构建一个与此类似的表: td
当我想设置 td 的宽度时,我将 td 设置为如下宽度: ... 我已经看到通过添加一个空的 div 来设置 td 宽度: some text .h-间隔符{ 高度:0; 宽度:0; 溢
我有以下 HTML 表格: Products Pack Of Quantity Volume Unit Reb
我需要提升文本,但如果我将类应用于 IE、Opera 和 Chrome 中的 TD 或 TR,则所有单元格都会提升(背景和边框以及单元格中的文本)。请看例子: Untitled D
我试图在所有 之间放置边距除了 的 margin-top在第一行, 的底部边距在最后一行。那可能吗?谢谢。 table { border: 1px solid black; width: 98%;
我需要发布我的 td 标签的这些值,因为这是一个使用 jquery 的可编辑表。我不确定这里的问题是脚本还是 td 标签?目前我的 var_dump($_POST) 没有返回任何值。 参见下面的代码,
我想检查当前网格单元格是否是行中最后一个可见单元格。 //accurately confirms if cell is the last cell in the row, assuming there
我是一名优秀的程序员,十分优秀!