Skip to content

Commit

Permalink
Corrects typo, and adds config readme docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rendez committed May 13, 2014
1 parent 0d3498c commit eacb381
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ OuiBounce offers a few options, such as:
- [Timer](#set-a-min-time-before-ouibounce-fires)
- [Callback](#callback)
- [Cookie expiration](#cookie-expiration)
- [Cookie domain](#cookie-domain)
- [Sitewide cookie](#sitewide-cookie)
- [Chaining options](#chaining-options)

Expand Down Expand Up @@ -109,6 +110,21 @@ _Example:_
ouibounce(document.getElementById('ouibounce-modal'), { cookieExpire: 10 });
```

##### Cookie domain
Ouibounce sets a cookie by default to prevent the modal from appearing
more than once per user. You can add a cookie domain using
`cookieDomain` to specify the domain under which the cookie should work.
By default, no extra domain information will be added. If you need a
cookie to work also in your subdomain (like blog.example.com and
example.com), then set a cookieDomain such as .example.com (notice the
dot in front).

_Example:_
```js
ouibounce(document.getElementById('ouibounce-modal'), { cookieDomain:
'.example.com' });
```

##### Sitewide cookie
You can drop sitewide cookies by using this option.

Expand All @@ -125,6 +141,7 @@ _Example:_
ouibounce(document.getElementById('ouibounce-modal'), {
aggressive: true,
sitewide: true,
cookieDomain: '.example.com',
timer: 0,
callback: function() { console.log('ouibounce fired!'); }
});
Expand Down
3 changes: 2 additions & 1 deletion build/ouibounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ return function ouibounce(el, config) {
cookieDomain = options.cookieDomain;
}

document.cookie = 'viewedOuibounceModal=true' + cookieExpire + ookieDomain + sitewide;
document.cookie = 'viewedOuibounceModal=true' + cookieExpire + cookieDomain + sitewide;

// remove listeners
_html.removeEventListener('mouseout', handleMouseout);
Expand All @@ -112,6 +112,7 @@ return function ouibounce(el, config) {
disable: disable
};
}

;

}));
2 changes: 1 addition & 1 deletion build/ouibounce.min.js

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

3 changes: 2 additions & 1 deletion source/ouibounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function ouibounce(el, config) {
cookieDomain = options.cookieDomain;
}

document.cookie = 'viewedOuibounceModal=true' + cookieExpire + ookieDomain + sitewide;
document.cookie = 'viewedOuibounceModal=true' + cookieExpire + cookieDomain + sitewide;

// remove listeners
_html.removeEventListener('mouseout', handleMouseout);
Expand All @@ -100,3 +100,4 @@ function ouibounce(el, config) {
disable: disable
};
}

0 comments on commit eacb381

Please sign in to comment.