<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html><html class=''>
<head><script src='//production-assets.codepen.io/assets/editor/live/console_runner-079c09a0e3b9ff743e39ee2d5637b9216b3545af0de366d4b9aad9dc87e26bfd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/events_runner-73716630c22bbc8cff4bd0f07b135f00a0bdc5d14629260c3ec49e5606f98fdd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/css_live_reload_init-2c0dc5167d60a5af3ee189d570b1835129687ea2a61bee3513dee3a50c115a77.js'></script><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/joseflores8082/pen/XbEgme?depth=everything&limit=all&order=popularity&page=31&q=text&show_forks=false" />
<style class="cp-pen-styles">body,
html {
width:100%;
height:100%;
}
body {
margin:0;
font-size:100%;
background:rgba(14, 24, 33, 0.95);
font-family:'Sentinel A', 'Sentinel B', Georgia, serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.wrapper {
position:relative;
transform:translateY(-50%);
top:50%;
margin: 0 auto;
width:75%;
overflow:hidden;
}
.wrapper p {
position:absolute;
left:100%;
width:100%;
font-size:2em;
color:#ffffff;
top:0;
cursor:pointer;
opacity:0;
transition:left 1.4s, opacity .5s ease;
}
.wrapper p.activeText {
position:relative;
left:0;
opacity:1;
}
.wrapper p.slideLeft {
left:-100%;
opacity:0;
}
.wrapper p:before {
content:"\201C";
font-size: 3em;
line-height: 0.1em;
margin-right: 0.1em;
vertical-align: -0.4em;
}
.wrapper p:after {
content:"\201D";
font-size: 3em;
line-height: 0.1em;
margin-left: 0.1em;
vertical-align: -0.45em;
}
ul {
margin:0;
padding:0;
text-align:center;
}
ul li {
list-style:none;
}
.dot {
width:10px;
height:10px;
border-radius:100px;
background:#7f8c8d;
display:inline-block;
text-lign:center;
cursor:pointer;
}
.active {
background:#ecf0f1;
}
</style></head><body>
<div class="wrapper" id="wrapper">
<p class="">First Slide text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard <span class="italic">dummy text ever since the 1500s,</span> when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
<p class="">Second Slide text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard <span class="italic">dummy text ever since the 1500s,</span> when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
<p class="">Third Slide text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard <span class="italic">dummy text ever since the 1500s,</span> when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
<ul class="dots-wrap">
<li class="dot"></li>
<li class="dot"></li>
<li class="dot"></li>
</ul>
</div>
<script src='//production-assets.codepen.io/assets/common/stopExecutionOnTimeout-b2a7b3fe212eaa732349046d8416e00a9dec26eb7fd347590fbced3ab38af52e.js'></script><script src='//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script >var commentSlider = {
'config' : {
'container' : $('#wrapper')
},
'init' : function(config) {
if(config && typeof(config) == 'object') {
$.extend(commentSlider.config, config);
}
//caching dom elements
//wrapper
commentSlider.$container = commentSlider.config.container;
//all paragraph tags
commentSlider.$paragraphs = commentSlider.$container.
find('p');
//all li tags
commentSlider.$dots = commentSlider.$container.
find('ul.dots-wrap > li');
//first li within ul.dots-wrap
commentSlider.$firstDot = commentSlider.$container.
find('ul.dots-wrap > li:first-child');
//first p tag within module wrapper
commentSlider.$firstParagraph = commentSlider.$container.
find('p:first-child');
//setting first dot with .active class
commentSlider.$firstDot.addClass('active');
//setting first paragraph tag with .active class
commentSlider.$firstParagraph.addClass('activeText');
//initializing functions and defining their parameters
commentSlider.currentItem(commentSlider.$paragraphs, commentSlider.$dots);
commentSlider.setActiveDot(commentSlider.$dots);
commentSlider.timer();
},
//timer function runs necesary functions every five seconds
'timer' : function() {
setInterval(function(){
}, 5000);
}, //timer function end
//grabs current numerical class of dot clicked
'dotNumber' : function($dot) {
var dotClassArray = [];
var dotClassList = dotClassArray.push($dot.attr('class'));
var splitArray = dotClassArray.toString().split(' ');
for(i = 0; i < splitArray.length; i++) {
if (splitArray[i] === "dot") {
splitArray.splice(i, 1);
var dotClickedNumber = splitArray[i];
commentSlider.paragraphNumber(dotClickedNumber, commentSlider.$paragraphs);
}
}
},//end dotNumber
'paragraphNumber' : function(dotClickedNumber, $paragraphs) {
$paragraphs.each(function() {
var $paragraph = $(this);
var paragraphClass = $paragraph.attr('class');
if(paragraphClass === dotClickedNumber) {
$paragraph.addClass('activeText');
$paragraph.siblings().removeClass('activeText').addClass('slideLeft');
setTimeout(function () {
$paragraph.siblings().removeClass('slideLeft');
}, 400);
}
});
},//end paragraphNumber
//currentItem function gives every paragraph and dot a numerical class
//based on their array position
'currentItem' : function($paragraphs, $dots) {
$paragraphs.each(function(i) {
var $paragraph = $(this);
$paragraph.addClass([] + i);
});
$dots.each(function(i) {
var $dot = $(this);
$dot.addClass([] + i);
});
},//end currentItem
//setActiveDot adds class active to whichever dot is clicked
'setActiveDot' : function($dots) {
$dots.each( function() {
var $dot = $(this);
$dot.on('click', function() {
if($dot.hasClass('active')) {
return false;
} else {
$dot.addClass('active');
$dot.siblings().removeClass('active');
}
commentSlider.dotNumber($dot);
});
});
}//end setActiveDot
};
//initializes the entire thing by calling the init function
$(document).ready(commentSlider.init);
//# sourceURL=pen.js
</script>
</body></html>