好吧,这是我在这里的第一个主题,所以就在这里!
我刚刚完成了一个非常简单的 :hover 代码,您可以在其中将鼠标悬停在图像上,并且其下方的标题显示为完整。更具体地说,在这段代码中,我有两种类型的标题,一种在图像上方,一种在图像正下方,当您将鼠标悬停在其上方时可以找到它们。
:hover 效果很好,但是我需要添加一个简单的效果,只是一点点线性过渡。所以我在“a”标签中添加了最基本的过渡,但它根本不起作用!我猜的代码是不承认的顶部:0像素的.featured横幅一类和底部:0像素的.featured横幅:悬停。
有没有人有解决方案?我感谢你们帮助我!
哦,以防万一,字幕类中的文字是用葡萄牙语写的,但不是很有趣,只是坎昆的广告!=P
这是我正在使用的 HTML:
<div class="featured-banner">
<a href="#">
<div class="caption">
<p>Mega Oferta • Cancún • Carnaval 2014</p>
</div>
<img src="http://www.advtour.com.br/sample-cancun.jpg" />
<div class="under-caption">A partir de US$ 2.148 Ou entrada + 11x de R$ 358</div>
</a>
Run Code Online (Sandbox Code Playgroud)
这是CSS:
.featured-banner {
width:930px;
height:350px;
background:#000;
font-family:sans-serif;
font-size:23px;
margin:14px 0px;
overflow:hidden;
position:relative;
}
.featured-banner a {
text-decoration:none;
position:absolute;
top:0;
-webkit-transition:all 1s ease;
-moz-transition:all 1s ease;
-ms-transition:all 1s ease;
-o-transition:all 1s ease; …Run Code Online (Sandbox Code Playgroud) 为了打印一组数据,在我的网页框架,我创建一个JavaScript function将其设置为onClick一个a标签.但是,该功能只是在单击打印时只获得一个参数,而不是所有参数.
所以我制作了HTML:
<div id="services">Services available</div>
<div id="products">Products available</div>
Run Code Online (Sandbox Code Playgroud)
和javascript函数(有两个参数):
function Popup(data1, data2) {
var printWindow = window.open('', 'Page', 'width=600,height=600,left=400');
printWindow.document.write(data1);
printWindow.document.write(data2);
return true;
}
function PrintElem(elem1, elem2) {
Popup($(elem1, elem2).html());
}
Run Code Online (Sandbox Code Playgroud)
而a标签被设置为被点击并打开一个弹出窗口.窗口打开,服务可用,但产品不显示和输出undefined
<a onClick="PrintElem('#services, #products')">Print page</a>
Run Code Online (Sandbox Code Playgroud)
如何让函数读取两个ID?