我试图在一段文本的底部获得一个很好的淡出效果作为"更多阅读"指标.
我一直在关注这个和其他教程,我的代码目前如下:
<section>
<p>malesuada fames ac turpis egestas...leo.</p>
<p>malesuada fames ac turpis egestas...leo.</p>
<div class="fadeout"></div>
</section>
<p>Stuff after</p>
Run Code Online (Sandbox Code Playgroud)
.fadeout {
position: relative;
bottom: 4em;
height: 4em;
background: -webkit-linear-gradient(
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 1) 100%
);
}
Run Code Online (Sandbox Code Playgroud)
问题是,即使我将透明div放在文本主体上,4em的空间仍然存在于'Other Stuff'之间.
有任何想法吗?
我正试图在#primary中使用jQuery通过AJAX加载URL的#content.它加载但不会淡入.我究竟做错了什么?
$('.menu a').live('click', function(event) {
var link = $(this).attr('href');
$('#content').fadeOut('slow', function(){
$('#primary').load(link+' #content', function(){
$('#content').fadeIn('slow');
});
});
return false;
});
Run Code Online (Sandbox Code Playgroud)
非常感谢您的帮助.
我想做的就是在页面加载时淡化我的徽标.我今天是jQuery的新手,我无法在负载上设法淡出请帮忙.对不起,如果这个问题已经得到解答,我已经看了一眼,并尝试针对不同的问题调整其他答案,但似乎没有任何工作,它开始让我感到沮丧.
谢谢.
码:
<script type="text/javascript">
$(function () {
.load(function () {
// set the image hidden by default
$('#logo').hide();.fadeIn(3000);
}}
</script>
<link rel="stylesheet" href="challenge.css"/>
<title>Acme Widgets</title>
</head>
<body>
<div id="wrapper">
<div id="header">
<img id="logo" src="logo-smaller.jpg" />
</div>
<div id="nav">
navigation
</div>
<div id="leftCol">
left col
</div>
<div id="rightCol">
<div id="header2">
header 2
</div>
<div id="centreCol">
body text
</div>
<div id="rightCol2">
right col
</div>
</div>
<div id="footer">
footer
</div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 任何人都可以告诉我为什么.jpg不会在IE8中淡入淡出或淡出.现在它只是消失并重新出现,没有不透明度的变化.我在本地设置并在发布服务器上设置,奇怪的是图像在本地淡入淡出,只有当我去发布服务器时才停止淡出.
只是想知道我是否遗漏了某些人可以迅速帮助我摆脱困境的事情.
这是发布服务器上的gcRotateContent,如果我只是抛出一个图像并执行淡入淡出它可以工作,由于某种原因它不适用于此标记.
<div class="gcRotateContent">
<div id="USCFRR2EN" class="gcEmployeeProfile">
<div class="gcEmployeeProfileHeading">
Meet John</div>
<div class="gcEmployeeProfileContent">
<div class="gcEmployeeProfileHRPad">
</div>
<div class="gcEmployeeProfileHR">
</div>
<div class="gcEmployeeProfileHRPad">
</div>
<div class="gcEmployeeProfileSLVideo">
<img src="/PublishingImages/Profile_JOHN-190x96.jpg" alt="Portrait of employee John."
height="96" width="190"></div>
<div class="gcEmployeeProfileName">
</div>
<div class="gcEmployeeProfileTitle">
Software Development Lead, Server Performance</div>
<div class="gcEmployeeProfileQuote">
“You will find no other company with the sheer breadth of technologies. The things you get to see and learn from other
people are amazing.”</div>
</div>
<div class="gcEmployeeProfileFooter">
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
<div class="gcRotate">
<div class="gcRotateContent"> …
Run Code Online (Sandbox Code Playgroud) 我有一个带有动画的UIImageView,在UIView中,我应用了一个fadeIn效果,但我需要在触摸时动画的UIImageView应用淡出.
这就是我为淡入而做的.
UIView.animateWithDuration(0.5, delay: delay,
options: UIViewAnimationOptions.CurveEaseOut, animations: {
uiImageView.alpha = 1.0
}
Run Code Online (Sandbox Code Playgroud) 我正在制作一个图片库应用程序.我目前有一个带有文本视图的imageview.目前它只是半透明的.我想让它淡入,等待3秒,然后淡出90%.引起关注或加载新图片将使其重复循环.我已经阅读了十几页,并尝试了一些事情,没有成功.我得到的只是淡入淡出并立即淡出
我有一个TextView
,我正在尝试添加淡入淡出的动画.我的代码正在返回null
,我不明白为什么.
这是我的实施
这是 fade_in.xml
<alpha
xmlns:android="http://schemas.android.com/apk/res/android" android:fillAfter="true"
android:duration="1000"
android:fromAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="1.0"/>
Run Code Online (Sandbox Code Playgroud)
以下是如何在相应的活动中使用它
tv= (TextView)findViewById(R.id.textView);
//-- the below line is returning null
animation = AnimationUtils.loadAnimation(this,R.anim.fade_in);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
tv.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd(Animation animation) {
Intent it = new Intent(SplashActivity.this, MainActivity.class);
startActivity(it);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
tv.startAnimation(animation);
Run Code Online (Sandbox Code Playgroud) 我有这个功能,适用于延迟加载.
panel.find('img[data-src]').each(function(){
element = $(this);
element.attr('src', element.data('src'));
element.removeAttr('data-src');
Run Code Online (Sandbox Code Playgroud)
如何fadeIn()
对removeAttr函数产生影响?
我试过了:
element.removeAttr('data-src').fadeIn();
Run Code Online (Sandbox Code Playgroud)
但它不起作用.该img
代码看起来是这样的,我只是想在dot.png到淡出和淡入的original.jpg.
<img src="dot.png" data-src="original.jpg">
Run Code Online (Sandbox Code Playgroud)
我想将一个fadeIn效果应用于addClass函数..并将fadeOut应用于removeClass ...
你能帮助我吗?
这是我的代码
$('#loader'+idTurno).addClass('loader');
Run Code Online (Sandbox Code Playgroud)
...
$('#loader'+idTurno).removeClass('loader');
Run Code Online (Sandbox Code Playgroud) jQuery(document).ready(function(){
$(".welcome").fadeOut(9500);
$(".freelance").fadeIn(10000);
$(".freelance").fadeOut(4500);
});
Run Code Online (Sandbox Code Playgroud)
我希望欢迎消息慢慢淡出然后另一个div淡出它的位置然后fadeOut - 显然当欢迎盒不再存在时.
<header>
<h1 class="left"><a href="index.html"></a></h1>
<div class="left yellowbox welcome"><p>Welcome to my portfolio.</p></div>
<div class="left greenbox freelance"><p>I am currently available for for work, contact me below.</p></div>
</header>
Run Code Online (Sandbox Code Playgroud)