I'm using ui-scrollfix directive from UI.Utils to make so called sticky header. It works fine. There are two headers in the app. Main one is constantly on the page and second one appears only in certain pages.
<div id="main-header" ui-scrollfix></div>
<div id="second-header" ui-scrollfix></div>
What I need to do is that ui-scrollfix directive was added or applied to main-header, if second-header is present.
Is that possible to achieve?
Thank you!
I think should do this by wrapping both headers in a directive say
headers. And then in the said directive query for the second header, if it exists then apply theui-scrollfixdirective to it.HTML
JS
JSFIDDLE