我已经在我的招聘网站上工作了几天了。我是编程新手。请我需要脚本,将加载就业审查内容淡出在每个就业空缺div的点击淡出,并在点击“关闭”在就业审查内容页面淡出。谢谢。


发布于 2017-08-18 09:50:58
您可以使用jquery来实现这一点:http://api.jquery.com/fadeout/
$( "#vacancy-div-id" ).click(function() {
$( "#id-of-what-you-want-to-fade-out" ).fadeOut( "slow", function() {
// Animation complete.
});
});要淡入,可以使用以下命令:http://api.jquery.com/fadein/
$( "#close-button-id" ).click(function() {
$( "#id-of-what-you-want-to-fade-in" ).fadeIn( "slow", function() {
// Animation complete
});
});更详细的例子-把这个放到你的html中:
<script>
$( "#close-button-id" ).click(function() {
$( "#id-of-what-you-want-to-fade-in" ).fadeIn( "slow", function() {
// Animation complete
});
});
</script>如果你不知道你想要被点击来触发fadeIn动画的id,你可以右键点击元素,然后点击inspect,它会向你显示你的页面的html。
发布于 2017-10-02 12:55:20
#start{
height:100px;
width:300px;
border:3px solid red;
display: none;
}
#start.fadeIn{
display: block;
animation-name:fadein;
animation-duration:3s;
}
@keyframes fadein {
from {
opacity:0;
}
to {
opacity:1;
}
}
document.getElementById('run').addEventListener('click',function(){
document.getElementById('start').classList.toggle('fadeIn');
})
<div id="start" class="rotating">
some text some text some text some text some text
</div>https://stackoverflow.com/questions/45747287
复制相似问题