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="destaques" class="row-fluid">
  <div class="span12 first last-column sombra" style="padding:0;margin:0;background-color:#E6E6E6;">
    <div id="img-destaque" class="mk-text-block first-column span7" style="padding:0;margin:0;height:530px;background-attachment: scroll;background-size: cover;background-position: 0% 0%; background-repeat: no-repeat no-repeat;">
      <img class="img-noticia1" src="http://lorempixel.com/1000/768/fashion/2" alt="" />
      <img class="img-noticia2" src="http://lorempixel.com/1000/768/fashion/3" alt="" />
      <img class="img-noticia3" src="http://lorempixel.com/1000/768/fashion/4" alt="" />
    </div>
    <div id="cont-destaque"  class="mk-text-block last-column span5" style="padding:0;margin:0;">
      <p id="titulo" class="titulo_destaque">Chanel A/W 2014</p>
      <p id="texto" class="text">
      Lorem Ipsum é simplesmente uma simulação detexto da indústria tipográfica e de impressos, e vem sendoutilizado desde o século XVI, quando um impressor.
      </p>
      <a class="bt_ler" href="ddddddddd">ler</a>
    </div>
    <div>BOTÕES DE NAVEGAÇÃO</div>
    <div class="clearboth"></div>
  </div>				
  <div class="clearboth"></div>
</div>		
<div class="clearboth"></div>
              
            
!

CSS

              
                #img-destaque {
  position: relative;
  overflow: hidden;
}
.img-noticia2,
.img-noticia3 {
  display: none;
  position: absolute;
}
              
            
!

JS

              
                var noticiaDestaque = [];
var slideImg = [];
slideImg[0] = $('.img-noticia1');
slideImg[1] = $('.img-noticia2');
slideImg[2] = $('.img-noticia3');
noticiaDestaque[0] = {
  idNoticia: "noticia0",
  imagemSrc: "url(http://lorempixel.com/1366/590/fashion/2)",
  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: "url(http://lorempixel.com/1366/590/fashion/3)",
  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: "url(http://lorempixel.com/1366/590/fashion/4)",
  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 = $("#destaques"),
       $btnLer = $(".bt_ler"),
       $imagem = $("#img-destaque"),
       $imagem1 = $("#img-destaque .img-noticia1"),
       $imagem2 = $("#img-destaque .img-noticia2"),
       $imagem3 = $("#img-destaque .img-noticia3"),
       $btnRight = $("#destaques .btn-right"),
       $btnLeft = $("#destaques .btn-left"),
       $destaqueH4 = $("#titulo"),
       $destaqueP = $("#texto"),
       $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);
      // $imagem.css("background-image",noticiaDestaque[i].imagemSrc);
      $("#img-destaque 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);
      // $imagem.css("background-image",noticiaDestaque[i].imagemSrc);
      $("#img-destaque img").fadeOut("slow");
      slideImg[i].fadeIn("slow");
      $destaqueP.text(noticiaDestaque[i].p);
      $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);
      // $imagem.css("background-image",noticiaDestaque[i].imagemSrc);
      $("#img-destaque 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");
      // $imagem.css("background-image",noticiaDestaque[i].imagemSrc);
      
      $btnLer.attr("href",noticiaDestaque[i].link);
      $slider.addClass(noticiaDestaque[i].idNoticia);
    }
  }
  $btnLeft.on('click', function(){
    slidePrev($current);
  });
  $btnRight.on('click', function(){
    slideNext($current);
  });
  var $run = setInterval(function(){
    slideNext($current);
  },10000);
}); //fim do jQuery
              
            
!
999px

Console