Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                  <div id="slider" class="slider-box">
    <img class="slide-img-1" src="http://lorempixel.com/1366/590/fashion/2" alt="Descricao da imagem" />
    <img class="slide-img-2" src="http://lorempixel.com/1366/590/fashion/3" alt="Descricao da imagem" />
    <img class="slide-img-3" src="http://lorempixel.com/1366/590/fashion/4" alt="Descricao da imagem" /><!-- O SRC e o ALT tem que ser dinanico-->
    <div class="destaque-box">
      <h4>Chanel A/W 2014</h4> <!-- o H4 tem que ser dinamico-->
      <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Impedit eveniet quisquam officiis excepturi nesciunt quas esse autem similique nobis eos ea reiciendis rerum harum. Nihil rerum enim placeat deleniti neque.
      </p>  
      <a class="bt_ler" href="">Ler</a> <!-- href tem que ser dinamico-->
      <div class="botoes-navegacao clearfix">
        <a class="btn-left" href="#">&lt;</a>
        <a class="slide-nav-1" href="#">0</a>
        <a class="slide-nav-2" href="#">0</a>
        <a class="slide-nav-3" href="#">0</a>
        <a class="btn-right" href="#">&gt;</a>
      </div>
    </div>
  </div>
              
            
!

CSS

              
                .slider-box {
  position: relative;
  height: 540px;
  overflow: hidden;
}
.slider-box img {
  z-index: 1;
  position: absolute;
  left: 0;
  top: 0;
}
.destaque-box {
  width: 390px;
  min-height: 495px;
  position: absolute;
  right: 0;
  top: 0;
  background: #F8F8F8;
  z-index: 2;
}
.bt_ler {
  margin: 0 auto;
  text-align: center;
  padding: .5em;
  border-radius: 17px;
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(100,100,100,.7);
  width: 100px;
  display: block;
  text-decoration: none;
  color: #FFF;
  background: #fdb913;
}
.destaque-box {
  padding: 2em;
}
.destaque-box h4 {
  text-align: center;
  margin: 0;
  padding: 0;
  font-family: serif;
  font-size: 5em;
}
.destaque-box p {
  text-align: center;
}
.botoes-navegacao {
  width: 180px;
  bottom: 30px;
  left: 50%;
  margin-left: -90px;
  position: absolute;
}
.botoes-navegacao .btn-left,
.botoes-navegacao .btn-right {
  text-decoration: none;
  font-size: 2em;
  text-align: center;
  border-radius: 100%;
  margin-left: 1em;
  float: left;
  padding: .4em;
  width: 1em;
  height: 1em;
  display: block;
  color: #FFF;
  background: #010101;
}
.slide-img-2,
.slide-img-3{
  display: none;
}
.slide-nav-1,
.slide-nav-2,
.slide-nav-3 {
  float: left;
  backgrounf: red;
}
.clearfix:after {
    content: "";
    display: table;
    clear: both;
}
@media screen and (max-width: 1020px) {
  .destaque-box {
    position: relative;
    width: 100%;
  }
  .slider-box img {
    position: relative;
    max-width: 100%;
  }
  .slider-box {
    height: auto;
  }
}
              
            
!

JS

              
                var noticiaDestaque = [];
var slideImg = [];
slideImg[0] = $('.slide-img-1');
slideImg[1] = $('.slide-img-2');
slideImg[2] = $('.slide-img-3')
var $slideNav = [];
$slideNav[0] = $(".slide-nav-1");
$slideNav[1] = $(".slide-nav-2");
$slideNav[2] = $(".slide-nav-3");
noticiaDestaque[0] = {
  idNoticia: "noticia0",
  imagemSrc: "imagem1",
  imagemAlt: "Imagem 1",
  h4: "Chanel A/W 2014",
  p: "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Impedit eveniet quisquam officiis excepturi nesciunt quas esse autem similique nobis eos ea reiciendis rerum harum. Nihil rerum enim placeat deleniti neque.",
  link: "#noticia1"
};
noticiaDestaque[1] = {
  idNoticia: "noticia1",
  imagemSrc: "imagem2",
  imagemAlt: "Imagem 2",
  h4: "Noticia 2",
  p: "Consectetur adipisicing elit. Impedit eveniet quisquam officiis excepturi nesciunt quas esse autem similique nobis eos ea reiciendis rerum harum. Nihil rerum enim placeat deleniti neque.Lorem ipsum dolor sit amet, ",
  link: "#noticia2"
};
noticiaDestaque[2] = {
  idNoticia: "noticia2",
  imagemSrc: "imagem3",
  imagemAlt: "Imagem 3",
  h4: "Noticia 3",
  p: "Sit amet, consectetur adipisicing elit. Impedit eveniet quisquam officiis excepturi nesciunt quas esse autem similique nobis eos ea reiciendis rerum harum. Nihil rerum enim placeat deleniti neque.Lorem ipsum dolor ",
  link: "#noticia3"
};
$(document).ready(function(){
   var $slider = $("#slider"),
       $btnLer = $(".bt_ler"),
       $imagem1 = $("#slider .slide-img-1"),
       $imagem2 = $("#slider .slide-img-1"),
       $imagem3 = $("#slider .slide-img-1"),
       $btnRight = $("#slider .btn-right"),
       $btnLeft = $("#slider .btn-left"),
       $destaqueH4 = $(".destaque-box h4"),
       $destaqueP = $(".destaque-box p"),
       $current = 1;
  var slidePrev = function($current){
    if(i<3 & i>0){
      console.log(i)
      i -= 1;
      $destaqueH4.text(noticiaDestaque[i].h4);
      $destaqueP.text(noticiaDestaque[i].p);
      $("#slider img").fadeOut("slow");
      slideImg[i].fadeIn("slow");
      $btnLer.attr("href",noticiaDestaque[i].link);
      $slider.addClass(noticiaDestaque[i].idNoticia);
    }else{
      console.log(i)
      console.log("caiu")
      i = 2;
      $destaqueH4.text(noticiaDestaque[i].h4);
      $destaqueP.text(noticiaDestaque[i].p);
      $("#slider img").fadeOut("slow");
      slideImg[i].fadeIn("slow");
      $btnLer.attr("href",noticiaDestaque[i].link);
      $slider.addClass(noticiaDestaque[i].idNoticia);
    }
  }
  var slideNext = function($current){
    if(i<=1 & i>=0){
      i += 1;
      console.log(i)
      $destaqueH4.text(noticiaDestaque[i].h4);
      $destaqueP.text(noticiaDestaque[i].p);
      $("#slider img").fadeOut("slow");
      slideImg[i].fadeIn("slow");
      $btnLer.attr("href",noticiaDestaque[i].link);
      $slider.addClass(noticiaDestaque[i].idNoticia);
    }else{
      i = 0;
      console.log(i)
      $destaqueH4.text(noticiaDestaque[i].h4);
      $destaqueP.text(noticiaDestaque[i].p);
      $("#slider img").fadeOut("slow");
      slideImg[i].fadeIn("slow");
      $btnLer.attr("href",noticiaDestaque[i].link);
      $slider.addClass(noticiaDestaque[i].idNoticia);
    }
  }
  $btnLeft.on('click', function(){
    slidePrev($current);
  });
  $btnRight.on('click', function(){
    slideNext($current);
  });
  $slideNav[0].on('click', function(){
      $destaqueH4.text(noticiaDestaque[0].h4);
      $destaqueP.text(noticiaDestaque[0].p);
      $("#slider img").fadeOut("slow");
      slideImg[0].fadeIn("slow");
      $btnLer.attr("href",noticiaDestaque[0].link);
      $slider.addClass(noticiaDestaque[0].idNoticia);
    
  });
  $slideNav[1].on('click', function(){
      $destaqueH4.text(noticiaDestaque[1].h4);
      $destaqueP.text(noticiaDestaque[1].p);
      $("#slider img").fadeOut("slow");
      slideImg[1].fadeIn("slow");
      $btnLer.attr("href",noticiaDestaque[1].link);
      $slider.addClass(noticiaDestaque[1].idNoticia);
    
  });
  $slideNav[2].on('click', function(){
      $destaqueH4.text(noticiaDestaque[2].h4);
      $destaqueP.text(noticiaDestaque[2].p);
      $("#slider img").fadeOut("slow");
      slideImg[2].fadeIn("slow");
      $btnLer.attr("href",noticiaDestaque[2].link);
      $slider.addClass(noticiaDestaque[2].idNoticia);
    
  });
  var $run = setInterval(function(){
    slideNext($current);
  },10000);
}); //fim do jQuery
              
            
!
999px

Console