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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 class="streifen">
  
  <div class="layer hover">
    <div data="01" class="segment"></div>
    <div data="02" class="segment"></div>
    <div data="03" class="segment"></div>
    <div data="04" class="segment"></div>
    <div data="05" class="segment"></div>
  </div>
 
  <div class="layerColors">
    <div class="color01 colorSegment segment"></div>
    <div class="color02 colorSegment segment"></div>
    <div class="color03 colorSegment segment"></div>
    <div class="color04 colorSegment segment"></div>
    <div class="color05 colorSegment segment"></div>
  </div>
  
  <div class="layerImages">
    <div  class="imagesegment imagesegment01">
      <div class="wrapper wrapper01">
         <div class="cover cover01"></div>
        <img id="img01" src="https://unsplash.it/g/600/600?image=1021" />
      </div>    </div>
    <div class="imagesegment imagesegment02">
      <div class="wrapper wrapper02">
        <div class="cover cover02"></div>
        <img id="img02" src="https://unsplash.it/g/600/600?image=1016" />
      </div>    </div>
    <div class="imagesegment imagesegment03">
      <div class="wrapper wrapper03">
        <div class="cover cover03"></div>
        <img id="img03" src="https://unsplash.it/g/600/600?image=1017" />
      </div>    </div>
    <div class="imagesegment imagesegment04">
      <div class="wrapper wrapper04">
        <div class="cover cover04"></div>
        <img id="img04" src="https://unsplash.it/g/600/600?image=984" />
      </div>
    </div>
    <div class="imagesegment imagesegment05">
      <div class="wrapper wrapper05">
        <div class="cover cover05"></div>
        <img id="img05" src="https://unsplash.it/g/600/600?image=1016" />
      </div>
    </div>
  </div>
   

</div>
              
            
!

CSS

              
                body{overflow:hidden;}
.streifen{
  position:absolute;
  width: 500px;
  height: 200px;
  top:100px;
  left:50px;
  
}
.layer{
  position: absolute;
  width: 100%;
  height: 100%;
  z-index:99999;
}
.segment{
  position: relative;
  height: 100%;
  width: 100px;
  
  float: left;
}
.layerColors{
  position: absolute;
  width: 100%;
  height: 100%;
  z-index:1000;
  overflow:hidden;
}
.color01{
  background:#505050;
}
.color02{
  background: #5b5b5b;
}
.color03{
  background:#727070;
}
.color04{
  background:grey;
}
.color05{
  background:#ababab;
}
.layerImages{
  position: relative;
  width: 500px;
  height: 200px;
}
.wrapper {
  width:100%;
  height:100%;
  position:absolute;
  top:50%;
  right:0;
  overflow:hidden;
}

.cover,  img {
  position:absolute;
}

.cover {
  width:100%;
  height:100%;
  background:#ababab;
}
img{
  opacity:0;
}
.imagesegment{
  position: relative;
  height: 200px;
  width: 100px;
  float: left;
  top:50%;
}
.streifen img {
  position: relative;
  height: 100%;
  width: auto;
  top: 0;
  float:left;
}
.wrapper01, .wrapper02{
  right:none;
  left:0;
}
              
            
!

JS

              
                console.clear();

TweenLite.set('.imagesegment', {xPercent:0, yPercent:-50, });
TweenLite.set('.wrapper', {xPercent:0, yPercent:-50, });


var $hover = $('.hover div'),
    $imagesegment = $('.imagesegment'),
    $wrapper = $('.wrapper'),
    $cover = $('.cover'),
    $img = $('img'),
    $streifen = $('.streifen');

$hover.on('mouseenter', function(e) {
 
  var $thisID = $(this).attr('data'),
      $thisImagesegment = $(".imagesegment" + $thisID),
      $thisWrapper = $(".wrapper" + $thisID),
      $thisCover = $(".cover" + $thisID),
      $thisImg = $("#img" + $thisID);
  
  if($thisImagesegment.length || $thisWrapper.length || $thisImg.length || $thisID.length) {
    TweenLite.set($thisImagesegment,  {zIndex:5000});
    TweenLite.set($imagesegment.not($thisImagesegment),  {zIndex:1});

    TweenLite.to($thisWrapper, 0.6,{height:"240px",transformOrigin:"center"});
    TweenLite.to($wrapper.not($thisWrapper), 0, {height:"200px",transformOrigin:"center"});

    TweenLite.to($thisWrapper, 0.6, {width:"250px",delay:0.1,transformOrigin:"right"});
    TweenLite.to($wrapper.not($thisWrapper), 0, {width:"100px"});

    TweenLite.to($thisImg, 2, {autoAlpha:1, scale:1.5});
    TweenLite.to($img.not($thisImg), 0, {autoAlpha:0, scale:1});

    if( $thisID == 05){
      TweenMax.staggerTo('.colorSegment',0,{
         width:'100px',
         cycle:{background:["#505050", "#5b5b5b", "#727070", "grey", "#ababab"]
       }
       },0);
      
      TweenMax.staggerTo('.colorSegment',0.3,{
        cycle:{
          width:['30px','50px','70px','100px','250px']  
        },
        delay:0
      },0.2);
    }
    
     if( $thisID == 04){
       TweenMax.staggerTo('.colorSegment',0,{
        width:'100px',
         cycle:{background:["#505050", "#5b5b5b", "#727070", "grey", "#ababab"]}
       },0);
       
    //   TweenMax.staggerTo('.colorSegment',0.4,{
    //    cycle:{
    //      width:['30px','40px','50px','100px','250px'],
    //      background:['#BAE5B3','#BAF0B3','#BAE2BE','#BAF2C7','#CDE3AB'],
    //    },
    //     delay:0
    //  },0.2);
    } 
    
    console.log($thisID);
  }
  


});

$streifen.on('mouseleave', function() {
  TweenLite.to($wrapper, 0.5, {height:"200px",transformOrigin:"center"});
  TweenLite.to($wrapper, 0.5, {width:"100px",transformOrigin:"right"});
  TweenLite.to($img, 0.5, {autoAlpha:0, scale:1});
  TweenLite.to($imagesegment, 0, {zIndex:1,delay:0.5});
  TweenLite.to('.colorSegment',0,{width:'100px'});
});



              
            
!
999px

Console