如何排除背景图像
How to exclude background image?
我在style.css.中有下面的css
.mobile-base{
background-image:url("img/mobile-base.png");
background-size:cover;
background-repeat:no-repeat;
width:312px;
height:552px;
margin-bottom:-8px;
display: inline-block;
}
以及下面的html标记
<div class="col-sm-8 col-md-8 col-lg-8 someclass">
<div id="app-body-105">
<div class="mobile-base">
<img class="img-responsive alignleft" src="http://192.168.0.31/wp-content/uploads/2015/10/app-1.jpg" alt="">
</div>
<div class="content-base">
<h2>The Ultimate Night Out</h2>
<p>Phasellus semper massa sit amet metus dictum bibendum.
Donec at dui ipsum. Maecenas sagittis tincidunt magna. Proin
vulputate mauris porttitor semper venenatis. Nulla quis sem eget dolor eleifend elementum id at lorem
</p>
</div>
</div>
我想在类mobile-base
(带有src的图像)内的某个点击事件(任何随机ID
)上动画化图像,不包括css中定义的背景图像。
我尝试了下面这样的东西,但它为两个图像都设置了动画,我不希望背景图像设置动画。
$("#someID").click(function() {
$('#app-body-105' .mobile-base').show('slow');
});
如何使用jQuery或JS?
如果你只想为图像设置动画,你必须告诉jQuery只为所述元素设置动画:
$("#someID").click(function() {
$('#app-body-105 .mobile-base img').show('slow');
});
相关文章:
- 可以在这里为背景图像设置滤镜吗
- 使用 js 将背景图像设置为 HTML
- 如何使用css动画/javascript使具有背景图像的元素出现
- 循环浏览多个身体背景图像
- 背景图像顶部的滚动图像不移动
- 在pdfmake中嵌入背景图像
- 修复选择菜单时的背景图像
- 使用css()设置背景图像;不起作用
- 鼠标悬停时如何居中放大背景图像
- 强制谷歌为javascript背景图像编制索引
- 淡入不带HTML的背景图像
- 具有淡入淡出效果的全背景图像
- 未加载随机背景图像
- 背景图像前显示Javascript警报
- javascript背景图像位置循环
- CSS动画背景图像的过渡越来越暗
- "Ken Burns效应”;悬停背景图像
- 通过ID JavaScript显示随机背景图像
- JavaScript背景图像
- 带有图像和背景图像的ClipTo