A possible workaround for those with alignment issues
-
If you are having problems with alignment issues (as I was) please note:
This plugin relies on parent containers that are EXPLICITLY delcared position relative in the CSS. As an example, I build on Yootheme’s master template warp 7 – I was getting arbitrary spacing depending on responsive behavior etc. However, since the theme uses UIkit and both the widget and the sidebars are placed in uk-panel class divs, I could anchor measurements to those DIVs.
But what if those position relative containers aren’t direct parents? This plugin came in very handy:
I included it before the plugin code and altered two lines from:
var refPosition = $(ref).position().top; // Position of reference anchor var notePosition = $(note).position().top; // Position of sidenote
to
var refPosition = $(ref).positionRelative('.uk-panel').top; // Position of reference anchor var notePosition = $(note).positionRelative('.uk-panel').top; // Position of sidenote
This let me explicitly define the parent element I wanted to measure from – now I get perfect placement with no need for offset adjustments and because of how the template works, responsive behavior is for the sidebar notes to drop below the article content as a stack of footnotes – exactly what I wanted.
- The topic ‘A possible workaround for those with alignment issues’ is closed to new replies.