bbarakaci / fixto

A jQuery plugin for sticky positioning
MIT License
217 stars 57 forks source link

Dynamically created <div> is also adding left position #15

Closed djmtype closed 10 years ago

djmtype commented 10 years ago

When my targeted .mystickydiv is fixed, the generated sibling <div> (with no classname) created by this plugin also outputs the same left position coordinates as my targeted .mystickydiv.

Shouldn't the position of this nameless <div> be left: 0; instead? Because of it, my page is being unintentionally widened with an awkward horizontal scrollbar because it's adding both left positions together.

Yes, I could add a style overflow:hidden; on the parent <div> or modify this plugin by changing rst.left = styles.left; to rst.left = "0"; but I was curious if it might be a fault on my end.

By example, my results look like this:

<div style="visibility: hidden; display: block; width: 250px; height: 425px; margin: 0px; float: left; position: relative; top: auto; right: auto; bottom: auto; left: 913px;"></div> 

<div class="mystickydiv fixto-fixed" role="complementary" style="left: 913px; width: 250px; position: fixed; top: -36px;">
bbarakaci commented 10 years ago

Yes, a bug was introduced. Pushed a fix.