jQuery背景图片显示动态文字特效果



99 393 132



特效描述:jQuery背景图片显示动态文字特效果,jQuery背景图片显示动态文字特效果

代码结构

1. 引入CSS

<link href="css/royalslider.css" rel="stylesheet">
<link href="css/reset.css?v=1.0.4" rel="stylesheet">
<link href="css/skins/minimal-white/rs-minimal-white.css?v=1.0.4" rel="stylesheet">
<link href="css/royalslider.css" rel="stylesheet">
<link href="css/reset.css?v=1.0.4" rel="stylesheet">
<link href="css/skins/minimal-white/rs-minimal-white.css?v=1.0.4" rel="stylesheet">

2. 引入JS

<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/jquery.royalslider.min.js"></script>
<script src="js/jquery.easing-1.3.js"></script>
<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/jquery.royalslider.min.js"></script>
<script src="js/jquery.easing-1.3.js"></script>

3. HTML代码

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">    
<title>jQuery背景图片显示动态文字特效果</title>
<meta name="viewport" content="width = device-width, initial-scale = 1.0" />
<style>
#slider-with-blocks-1 {
width: 100%;
}
.rsContent {
color: #FFF;
font-size: 24px;
line-height: 32px;
float: left;
}
.bContainer {
position: relative;
}
.rsABlock {
position: relative;
display: block;
left: auto;
top: auto;
}
.blockHeadline {
font-size: 42px;
line-height: 50px;
}
.blockSubHeadline {
font-size: 32px;
line-height: 40px
}
.txtCent {
text-align: center; 
width: 100%; 
}
.slide1 {
background: #f06b50;
}
.slide1 .bContainer {
top: 36%;
}
.slide2 {
background: #ffbc11;
color:#000;
}
.slide2 .bContainer {
top: 24px;
}
.slide2 .txtCent {
line-height: 44px;
}
.slide2 .blockHeadline {
line-height: 66px;
}
.slide3 {
background: #45aab8;
color:#FFF;
}
.slide3 .bContainer {
top: 24px;
}
.slide3 span {
line-height: 44px;
}
.slide4 .bContainer {
position: absolute;
left: 0;
width: 100%;
height: auto;
top: 24px;
}
.photoCopy {
position: absolute;
line-height: 24px;
font-size: 12px;
background: black;
color: white;
background-color: rgba(0, 0, 0, 0.75);
padding: 0px 10px;
position: absolute;
left: 12px;
bottom: 12px;
top: auto;
border-radius: 2px;
z-index: 25;
}
.photoCopy a {
color: #FFF;
}
.palmImg {
left: 0;
top: auto;
bottom: -60px;
position: absolute;
}
@media screen and (min-width: 0px) and (max-width: 960px) { 
.rsContent {
font-size: 22px;
line-height: 28px;
}
.blockHeadline {
font-size: 32px;
line-height: 32px;
}
.blockSubHeadline {
font-size: 26px;
line-height: 32px
}
}
@media screen and (min-width: 0px) and (max-width: 500px) { 
.royalSlider,
.rsOverflow {
height: 330px !important;
}
.rsContent {
font-size: 18px;
line-height: 26px;
}
.blockHeadline {
font-size: 24px;
line-height: 32px;
}
.blockSubHeadline {
font-size: 22px;
line-height: 32px
}
}
</style>
</head>
<body >
<br>
<div  class="page wrapper main-wrapper">  
<div class="row clearfix">
<div class="col span_4 fwImage">
<div id="slider-with-blocks-1" class="royalSlider rsMinW  ">
<div class="rsContent slide1">
<div class="bContainer">
<strong class="rsABlock txtCent blockHeadline">This is an animated block</strong>
<span class="rsABlock txtCent" data-move-effect="none">you can place it on any type of slide</span>
</div>
</div>
<div class="rsContent slide2">
<div class="bContainer">
<strong class="rsABlock txtCent blockSubHeadline" data-move-effect="none">Transition Types</strong>
<span class="rsABlock txtCent" data-move-effect="top" >from top  ↓</span>
<span class="rsABlock txtCent" data-move-effect="bottom">from bottom ↑</span>
<span class="rsABlock txtCent" data-move-effect="left">from left →</span>
<span class="rsABlock txtCent" data-move-effect="right">from right ←</span>
<span class="rsABlock txtCent" data-move-effect="none">just fade</span>
</div>
</div>
<div class="rsContent slide3">
<div class="bContainer">
<strong class="rsABlock txtCent blockSubHeadline" data-move-effect="none"  data-delay="0">Customizable Animation</strong>
<span class="rsABlock txtCent" data-move-effect="left" data-delay="1000" data-move-offset="500" data-easing="easeOutBack"  data-fade-effect="none">easing</span>
<span class="rsABlock txtCent" data-move-effect="left" data-delay="1500" data-move-offset="500" data-fade-effect="none">delay</span>
<span class="rsABlock txtCent" data-move-effect="left" data-delay="2000" data-move-offset="500" data-speed="1000" data-fade-effect="none">speed</span>
<span class="rsABlock txtCent" data-move-effect="left" data-delay="2500" data-move-offset="50" data-fade-effect="true">move offset</span>
</div>
</div>
<div class="rsContent slide4">
<a class="rsImg" href="img/palmbw.jpg">palms & beach</a>
<div class="bContainer">
<strong class="rsABlock txtCent blockHeadline">Block may have any HTML</strong>
<span class="rsABlock txtCent" data-move-effect="none">and can be placed on any slide type</span>
</div>
<img class="rsABlock palmImg" data-fade-effect="none" data-move-effect="bottom" data-opposite="true" data-move-offset="450" data-delay="350" data-speed="300" data-easing="easeOutBack" src="img/palms.png" data-rsw="707" data-rsh="471"/>
<div class="photoCopy">Photo by <a href="http://www.51qianduan.com/">Laurent Aphecetche</a></div>
</div>
</div>
</div>
</div>
</div>
<script>
jQuery(document).ready(function($) {
jQuery.rsCSS3Easing.easeOutBack = 'cubic-bezier(0.175, 0.885, 0.320, 1.275)';
$('#slider-with-blocks-1').royalSlider({
arrowsNav: true,
arrowsNavAutoHide: false,
fadeinLoadedSlide: false,
controlNavigationSpacing: 0,
controlNavigation: 'bullets',
imageScaleMode: 'none',
imageAlignCenter:false,
blockLoop: true,
loop: true,
numImagesToPreload: 6,
transitionType: 'fade',
keyboardNavEnabled: true,
block: {
delay: 400
}
});
});
</script>
</body>
</html>



用户评论
大牛,别默默的看了,快登录帮我点评一下吧!:)      登录 | 注册


热门标签: 文字叠加 文字层叠 文字收缩展开 文字收缩 文字展开 文字放大缩小 文字缩放 文字大小 文字放大 文字缩小 文字变大 文字变小 文字淡出淡进 文字淡出 文字淡进 文字提示框 提示文字 文字拖动 文字拖拽 文字全屏 滑动选项卡 滑动切换 滚动切换 滚动条切换 文字延迟加载 文字延迟 文字加载 文字翻转 文字旋转 360全景 360度全景 h5文字动画 h5文字边框动画 html5文字动画 html5文字边框动画 文字滑动 文字滑块 文字滚动 文字无缝滚动 文字间歇滚动 文字切换 文字选项卡 选项卡切换 选项卡 切换 tab切换 页面切换 选项卡插件 切换插件 滑动手风琴 图片文字 渐隐切换 文字导航菜单 文字导航 文字菜单 淡出淡进 淡出 淡进 切换按钮 表单 表单美化 表单插件 表单美化插件 文字 文字插件 文字淡出淡进 文字淡出 文字淡进 彩色文字 文字切换 文字选项卡 选项卡自动切换 渐隐切换 按钮控制

×
×

注册

官方QQ群

扫描上面二维码加微信群

官方QQ群

jQuery/js讨论群
群号:642649996
Css3+Html5讨论群
群号:322131262

加群请备注:从官网了解到