Skip to content

Instantly share code, notes, and snippets.

@mrtag23
Created August 24, 2018 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrtag23/c38846107577a0f98c6b9cc422ed860a to your computer and use it in GitHub Desktop.
Save mrtag23/c38846107577a0f98c6b9cc422ed860a to your computer and use it in GitHub Desktop.
Adjusts top offset value depending on drupal toolbar status.
// Adjusts top offset depending on additional fixed positioned elements.
var windowOffsetAdjust = function() {
if ($window.width() < 1200) {
if ($body.hasClass('toolbar-vertical')) {
return 0;
} else {
// Adds header height.
return 60;
}
} else {
if ($body.hasClass('toolbar-horizontal toolbar-tray-open')) {
// Adds toolbar height.
return 39;
} else if($body.hasClass('toolbar-horizontal')) {
// Adds expanded toolbar height.
return 79;
} else {
return 0;
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment