Skip to content

Commit

Permalink
[fix] undefined error for top attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Panagiotis Papadatis committed Jul 25, 2017
1 parent 94f2582 commit d46408c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions js/floativ.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* displayed while browsing a web page. This floating box disappears when the user reaches an element with
* a specific id.
*
* Version 1.1.6
* Version 1.1.7
*
*/
(function ($) {
Expand Down Expand Up @@ -55,13 +55,15 @@
}

function floativToggle(){
if ($(o.breakPoint).length > 0 && $(o.breakPoint).offset() != null) {
try {
// Calculate at which point should the float box hide
if ($(window).scrollTop() > ($(o.breakPoint).offset().top - $(window).height() + o.floativOffsetpercentage)) {
$this.css({display: 'none'});
} else {
$this.css({display: 'block'});
}
} catch (err) {
$this.css({display: 'none'});
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "floativ",
"version": "1.1.5",
"version": "1.1.7",
"description": "floativ is a floating scroll-box at the bottom of the screen of your site that contains text, among other things, which can be displayed while browsing a web page. This floating scroll-box disappears when the user reaches an element with a specific id.",
"main": "floativ.js",
"scripts": {
Expand Down

0 comments on commit d46408c

Please sign in to comment.