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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import or require. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <section>
  
  <p>promoBox JavaScript Promo Popup Demo</p>
  
  <br />
  
  <p>
    <a id="startPromo" href="#">Trigger promoBox</a>
    <a id="startActionButtons" href="#">With buttons</a>
    <a id="startInterstitial" href="#">Interstitial</a>
    <a id="startDelayed" href="#">Delayed start</a>
  </p>
  
  <br />
  <br />

  <p>
    <a href="https://github.com/rolandtoth/promoBox" target="_blank" class="logo">promoBox</a>
  </p>
</section>
            
          
!
            
              /* demo page styles only */

body {
  background: #f4f4f4;
}

section {
  text-align: center; 
  padding: 30px 0;
}

section a {
  margin: 0 10px;
}

a.logo {
  color: #bbb; 
  text-decoration: none; 
  font-size: 13px; 
  font-weight: bold; 
  text-shadow: 1px 1px rgba(255, 255, 255, 0.5); 
  font-family: sans-serif;
}
            
          
!
            
              promoBox({
  imagePath: 'https://raw.githubusercontent.com/rolandtoth/promoBox/master/bird.jpg',
  link: 'https://github.com/rolandtoth/promoBox',
  target: '_blank',
  disableOverlay: false,
  disableOverlayClose: false,
  disableStyles: false,
  disableCloseButton: false,
  disableKeyClose: false,
  closeButtonText: '',
  //            showOnHash: '#promo',
  //            startDate: 'April 12, 2014 02:30:00',
  //            endDate: 'May 20, 2014 19:27:00',
  //            frequency: 0.33,
  deleteCookieOnUrl: '#clear',
  fadeInDuration: 0.5,
  fadeOutDuration: 0.2,
  loadDelay: 0.1,
  //            interstitialSkipText: 'Skip this advertisement',
  //            interstitialText: 'or wait %s secs',
  autoCloseSeconds: 30
});

var demoImage = 'https://raw.githubusercontent.com/rolandtoth/promoBox/master/breeze.jpg';

document.getElementById('startPromo').onclick = function () {
  promoBox({
    imagePath: demoImage,
    closeButtonText: 'close',
    fadeInDuration: 0.33,
    fadeOutDuration: 0.2
  });
  return false;
};

document.getElementById('startActionButtons').onclick = function () {
  promoBox({
    imagePath: demoImage,
    fadeInDuration: 0.33,
    fadeOutDuration: 0.2,
    actionButtons: [
      ['Visit GitHub', 'https://github.com/rolandtoth/promoBox', '_blank', 'external github'],
      ['Jump to anchor', '#anchor', '', 'jumpLink'],
      ['Cancel']
  ]
  });
  return false;
};

document.getElementById('startDelayed').onclick = function () {
  promoBox({
    imagePath: demoImage,
    fadeInDuration: 0.33,
    fadeOutDuration: 0.2,
    loadDelay: 2
  });
  return false;
};

document.getElementById('startInterstitial').onclick = function () {
  promoBox({
    imagePath: demoImage,
    fadeInDuration: 0.33,
    fadeOutDuration: 0.2,
    interstitialDuration: 30,
    interstitialSkipText: 'Close interstitial',
    interstitialText: 'or wait %s seconds to continue'
  });
  return false;
};

// callback functions

var promoBoxStart = function () {
  if (typeof console !== "undefined") {
    console.log('promoBox has started...');
  }
};
	
var promoBoxClick = function () {
  if (typeof console !== "undefined") {
    console.log('promoBox image was clicked');
  }
};
	
var promoBoxClose = function () {
  if (typeof console !== "undefined") {
    console.log('promoBox terminated');
  }
};
            
          
!
999px

Console