Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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="area_product">
  <div id="banner_text">BU ALAN SAYFAMIZIN EN TEPESİNDE YER ALACAK VE REKLAM ALANI OLARAK KULLANILACAK...</div>
</div>
<div>
  <script>
    for (var i = 0; i < 20; i++) {
      document.write("<p>Deneme yazı, scroll aşağıya çekin</p>");
    }
  </script>
</div>
              
            
!

CSS

              
                #area_product {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: black;
  color: white;
}
              
            
!

JS

              
                $(document).ready(function() {

  //Siyah bantın opacity değerini değiştiriyoruz
  $("#area_product").css({
    opacity: 0.85
  });

  //Sayfa kaydrıldığında .scroll() olayı tetikleniyor
  $(window).scroll(function() {

    //Sayfanın üsten uzaklığı alınıyor
    var scroll_top = $(window).scrollTop();

    //Sayfanın üstten kaydırma değeri 10'dan büyükse işlem yapılacak
    if ($(this).scrollTop() > 10) {

      //Siyah bantın üst değeri(top) animasyon ile belirtiliyor
      $("#area_product").animate({
        top: scroll_top
      }, 30);
    } else if ($(this).scrollTop() < 10) { //Sayfanın üstten kaydırma değeri
      $("#area_product").animate({ //10'dan küçükse bantın üst değeri 
        top: 0 //"0" olarak belirleniyor işlem 
      }, 30);
    }
  });
});
              
            
!
999px

Console