Skip to content

Commit

Permalink
🛠 allow fixed positioning; Fixes #134
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Jun 10, 2016
1 parent ea0e4b4 commit 66d22ae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion draggabilly.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ proto.option = function( opts ) {
extend( this.options, opts );
};

// css position values that don't need to be set
var positionValues = {
relative: true,
absolute: true,
fixed: true
};

proto._create = function() {

// properties
Expand All @@ -129,7 +136,7 @@ proto._create = function() {

// set relative positioning
var style = getComputedStyle( this.element );
if ( style.position != 'relative' && style.position != 'absolute' ) {
if ( !positionValues[ style.position ] ) {
this.element.style.position = 'relative';
}

Expand Down

0 comments on commit 66d22ae

Please sign in to comment.