jQuery背景圖片顯示動態文字特效果



104 414 139



特效描述: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.cqetom.live/">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

加群請備注:從官網了解到

老夫子电子