Skip to content

Commit

Permalink
add zIndex setter
Browse files Browse the repository at this point in the history
  • Loading branch information
nechehin committed Nov 8, 2017
1 parent 174fdef commit 42c434a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ catfish
.render();
```

### z-index

Set catfish z-index

```js
catfish
.zIndex('999')
.addFullscreenModeSlot('/your_slot_name', [320, 480])
.render();
```

### Enable debug log

```js
Expand Down Expand Up @@ -122,6 +133,7 @@ catfish
.debug(true)
.autoCloseTimeout(5000)
.backgroundColor('#fff')
.zIndex('999')
.addWidth(0, 480, function(){
this.addFullscreenModeSlot('/your_slot_name', [320, 480]);
this.addBottomModeSlot('/your_slot_name', [320, 100]);
Expand Down
16 changes: 15 additions & 1 deletion googletag-catfish.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/**
* Google-tag catfish
*
* @version 0.0.5
* @param {Object} gt GoogleTag object instance
* @return {Object}
*/
Expand All @@ -20,6 +21,7 @@ function googletagCatfish(gt) {
var debug = false;
var autoCloseTimeout = false;
var backgroundColor = 'transparent';
var zIndex = '999999';

var adsPlaceId = 'catfish-ads';

Expand Down Expand Up @@ -76,7 +78,7 @@ function googletagCatfish(gt) {
*/
function createAdsStyle() {
var css = '.gt-catfish-box { display: none; background-color: ' + backgroundColor + '; }';
css += '.gt-catfish-box.catfish-ads--visible { display: flex; position: fixed; align-items: center; justify-content: center; z-index: 999999; }';
css += '.gt-catfish-box.catfish-ads--visible { display: flex; position: fixed; align-items: center; justify-content: center; z-index: ' + zIndex + '; }';
css += '.catfish-ads--fullscreen { top: 0; right: 0; bottom: 0; left: 0; }';
css += '.catfish-ads--bottom { right: 0; bottom: 0; left: 0; }';
css += '.gt-catfish__button-close { position: absolute; top: 5px; left: 5px; width: 25px; height: 25px; background-color:#000;border-radius:50%;border:2px solid #fff;box-shadow:0 0 3px #666;background-size:100% 100%;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDQ4IDQ4IiB3aWR0aD0iMzAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTM4IDEyLjgzbC0yLjgzLTIuODMtMTEuMTcgMTEuMTctMTEuMTctMTEuMTctMi44MyAyLjgzIDExLjE3IDExLjE3LTExLjE3IDExLjE3IDIuODMgMi44MyAxMS4xNy0xMS4xNyAxMS4xNyAxMS4xNyAyLjgzLTIuODMtMTEuMTctMTEuMTd6IiBmaWxsPSIjZmZmZmZmIi8+Cjwvc3ZnPg==) }';
Expand Down Expand Up @@ -197,6 +199,18 @@ function googletagCatfish(gt) {
},


/**
* Set catfish zIndex
*
* @param {String} value new catfish zIndex
* @returns {Object}
*/
zIndex: function(value) {
zIndex = value;
return this;
},


/**
* Get google tag instance
*
Expand Down
11 changes: 6 additions & 5 deletions googletag-catfish.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 42c434a

Please sign in to comment.