Skip to main content

Text slider with script style

<style>

#carousel {
  position: relative;
  width: 100%;
 margin-bottom: 30%;
 margin-left: 0;
  margin-right: 0;
  background: #FFFFFF;
  height: 155px;
}

#slides {
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 250px;
  margin-bottom: -70%;
}

#slides ul {
  list-style: none;
  width: 100%;
  height: 250px;
  margin: 0;
  padding: 0;
  position: relative;
}

#slides li {
  width: 100%;
  height: 250px;
  float: left;
  text-align: center;
  position: relative;
  font-family: lato, sans-serif;
}

#slides H1 {
  font-size: 22px;
  padding-top: 0px;
  text-align: center;
  font-weight: normal;
}

/* Styling for prev and next buttons */

.btn-bar {
  width: 60%;
  margin: 0 auto;
  display: block;
  position: relative;
  top: 40px;
}

#buttons {
  padding: 0 0 5px 0;
  float: right;
}

#buttons a {
  text-align: center;
  display: block;
  font-size: 50px;
  float: left;
  outline: 0;
  margin: 0 60px;
  color: #b14943;
  text-decoration: none;
  display: block;
  padding: 9px;
  width: 35px;
}

a#prev:hover,
a#next:hover {
  color: #FFF;
  text-shadow: .5px 0px #b14943;
}

.quote-phrase,
.quote-author {
  font-family: sans-serif;
  font-weight: 300;
  display: table-cell;
  vertical-align: middle;
  padding: 5px 20px;
  font-family: 'Lato', Calibri, Arial, sans-serif;
}

.quote-phrase {
  height: 60px;
  font-size: 12px;
  color: black;
  font-style: italic;
  line-height: 1;
}

.quote-marks {
  font-size: 15px;
  padding: 0 3px 3px;
  position: inherit;
}

.quote-author {
  font-style: normal;
  font-size: 20px;
  color: #b14943;
  font-weight: 400;
  height: 30px;
}

.quoteContainer {
  display: table;
  width: 100%;
}

@media screen and (min-width: 767px) {
#carousel {
  position: relative;
  width: 80%;
  background: #FFFFFF;
  margin: auto;
  height: 185px;

}

#slides {
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 250px;
  margin-bottom: 0%;
}

#slides ul {
  list-style: none;
  width: 100%;
  height: 250px;
  margin: 0;
  padding: 0;
  position: relative;
}

#slides li {
  width: 100%;
  height: 250px;
  float: left;
  text-align: center;
  position: relative;
  font-family: lato, sans-serif;
}

#slides H1 {
  font-size: 39px;
  padding-top: 25px;
  text-align: center;
  font-weight: normal;
  margin-bottom: -40px;
}

/* Styling for prev and next buttons */

.btn-bar {
  width: 60%;
  margin: 0 auto;
  display: block;
  position: relative;
  top: 40px;
}

#buttons {
  padding: 0 0 5px 0;
  float: right;
}

#buttons a {
  text-align: center;
  display: block;
  font-size: 50px;
  float: left;
  outline: 0;
  margin: 0 60px;
  color: #b14943;
  text-decoration: none;
  display: block;
  padding: 9px;
  width: 35px;
}

a#prev:hover,
a#next:hover {
  color: #FFF;
  text-shadow: .5px 0px #b14943;
}

.quote-phrase,
.quote-author {
  font-family: sans-serif;
  font-weight: 300;
  display: table-cell;
  vertical-align: middle;
  padding: 5px 20px;
  font-family: 'Lato', Calibri, Arial, sans-serif;
}

.quote-phrase {
  height: 200px;
  font-size: 24px;
  color: black;
  font-style: italic;
  line-height: 1;
}

.quote-marks {
  font-size: 30px;
  padding: 0 3px 3px;
  position: inherit;
}

.quote-author {
  font-style: normal;
  font-size: 20px;
  color: #b14943;
  font-weight: 400;
  height: 30px;
}

.quoteContainer {
  display: table;
  width: 100%;
}
}

@media only screen
  and (min-device-width: 768px)
  and (max-device-width: 1024px)
  and (-webkit-min-device-pixel-ratio: 1) {

 #carousel {
  position: relative;
  width: 100%;
  background: #FFFFFF;
  margin: auto;
  height: 185px;

}

#slides {
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 250px;
  margin-bottom: 0%;
}

#slides ul {
  list-style: none;
  width: 100%;
  height: 250px;
  margin: 0;
  padding: 0;
  position: relative;
}

#slides li {
  width: 100%;
  height: 250px;
  float: left;
  text-align: center;
  position: relative;
  font-family: lato, sans-serif;
}

#slides H1 {
  font-size: 39px;
  padding-top: 25px;
  text-align: center;
  font-weight: normal;
}

/* Styling for prev and next buttons */

.btn-bar {
  width: 60%;
  margin: 0 auto;
  display: block;
  position: relative;
  top: 40px;
}

#buttons {
  padding: 0 0 5px 0;
  float: right;
}

#buttons a {
  text-align: center;
  display: block;
  font-size: 50px;
  float: left;
  outline: 0;
  margin: 0 60px;
  color: #b14943;
  text-decoration: none;
  display: block;
  padding: 9px;
  width: 35px;
}

a#prev:hover,
a#next:hover {
  color: #FFF;
  text-shadow: .5px 0px #b14943;
}

.quote-phrase,
.quote-author {
  font-family: sans-serif;
  font-weight: 300;
  display: table-cell;
  vertical-align: middle;
  padding: 5px 20px;
  font-family: 'Lato', Calibri, Arial, sans-serif;
}

.quote-phrase {
  height: 200px;
  font-size: 24px;
  color: black;
  font-style: italic;
  line-height: 1;
}

.quote-marks {
  font-size: 30px;
  padding: 0 3px 3px;
  position: inherit;
}

.quote-author {
  font-style: normal;
  font-size: 20px;
  color: #b14943;
  font-weight: 400;
  height: 30px;
}

.quoteContainer {
  display: table;
  width: 100%;
}
  }
</style>


<!--<div id="carousel">-->
<div>
  <div class="btn-bar">
    <div id="buttons"><a id="prev" href="#"></a><a id="next" href="#"></a> </div>
  </div>

  <div id="slides">
    <H1>YOUR TEXT</H1>

    <ul>        
      <li class="slide">
        <div class="quoteContainer">
          <p class="quote-phrase"><span class="quote-marks">"</span> A great resort which looks like it's going to get better. Great rooms, very clean, very modern and friendly staff. Also great value for money. We will return. <span class="quote-marks">"</span><br>-Sean, April 2016 </p>
        </div>
      </li>
 <li class="slide">
        <div class="quoteContainer">
          <p class="quote-phrase"><span class="quote-marks"></span> Perfect position, great rooms appointed well, caring helpful staff especially Michael! Priced right and the pools are magnificent. We will be back. <span class="quote-marks">"</span><br>-Nicole, September 2016 </p>
        </div>
      </li>
      <li class="slide">
        <div class="quoteContainer">
          <p class="quote-phrase"><span class="quote-marks">"</span>We have stay here many times. Lovely clean rooms. Staff very friendly. Grounds well kept and the pools. We be back again on my next holiday in darwin. <span class="quote-marks">"</span><br>-Jo, September 2016 </p>
        </div>
      </li>
 <li class="slide">
        <div class="quoteContainer">
          <p class="quote-phrase"><span class="quote-marks">"</span>Totally brilliant, facility's outstanding, staff fantastic, pool magic. Pool side villas are absolute dream to stay in. We stayed a month and wished for more. Coming back for sure.<span class="quote-marks">"</span><br> -Jud, July 2016 </p>
        </div>
      </li>
  <li class="slide">
        <div class="quoteContainer">
          <p class="quote-phrase"><span class="quote-marks">"</span>Absolutely loved it! Very affordable, clean rooms, friendly staffs. We held my Son's 5th birthday party at the BBQ area. Pool is massive.

I would highly recommend this resort. <span class="quote-marks">"</span><br>-Rosa, June 2016 </p>
        </div>
      </li>
    </ul>
  </div>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
$(document).ready(function () {
    //rotation speed and timer
    var speed = 3000;
 
    var run = setInterval(rotate, speed);
    var slides = $('.slide');
    var container = $('#slides ul');
    var elm = container.find(':first-child').prop("tagName");
    var item_width = container.width();
    var previous = 'prev'; //id of previous button
    var next = 'next'; //id of next button
    slides.width(item_width); //set the slides to the correct pixel width
    container.parent().width(item_width);
    container.width(slides.length * item_width); //set the slides container to the correct total width
    container.find(elm + ':first').before(container.find(elm + ':last'));
    resetSlides();
 
 
    //if user clicked on prev button
 
    $('#buttons a').click(function (e) {
        //slide the item
     
        if (container.is(':animated')) {
            return false;
        }
        if (e.target.id == previous) {
            container.stop().animate({
                'left': 0
            }, 1500, function () {
                container.find(elm + ':first').before(container.find(elm + ':last'));
                resetSlides();
            });
        }
     
        if (e.target.id == next) {
            container.stop().animate({
                'left': item_width * -2
            }, 1500, function () {
                container.find(elm + ':last').after(container.find(elm + ':first'));
                resetSlides();
            });
        }
     
        //cancel the link behavior          
        return false;
     
    });
 
    //if mouse hover, pause the auto rotation, otherwise rotate it  
    container.parent().mouseenter(function () {
        clearInterval(run);
    }).mouseleave(function () {
        run = setInterval(rotate, speed);
    });
 
 
    function resetSlides() {
        //and adjust the container so current is in the frame
        container.css({
            'left': -1 * item_width
        });
    }
 
});
//a simple function to click next link
//a timer will call this function, and the rotation will begin

function rotate() {
    $('#next').click();
}
</script>

Comments

Popular posts from this blog

bootstrap slider back to top

<script src = "//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" > </script> <link rel = "stylesheet" id = "font-awesome-css" href = "//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" type = "text/css" media = "screen" > copy anywhere in your page <div class="scroll-top-wrapper "> <span class="scroll-top-inner"> <i class="fa fa-2x fa-arrow-circle-up"></i> </span> </div> <style> .scroll-top-wrapper {     position: fixed; opacity: 0; visibility: hidden; overflow: hidden; text-align: center; z-index: 99999999;     background-color: #2E9BDC; color: #eeeeee; width: 50px; height: 48px; line-height: 48px; right: 30px; bottom: 30px; padding-top: 2px; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-rad...

embed play youtube video just from url

<? $videolink='https://www.youtube.com/watch?v=6SDlG8T2KRE'; $ytarray=explode("/", $videolink); $ytendstring=end($ytarray); $ytendarray=explode("?v=", $ytendstring); $ytendstring=end($ytendarray); $ytendarray=explode("&", $ytendstring); $ytcode=$ytendarray[0]; echo "<iframe width=\"420\" height=\"315\" src=\"http://www.youtube.com/embed/$ytcode\" frameborder=\"0\" allowfullscreen></iframe>"; ?>