Topic: Sticky Content Cross Component Referral
Joao pro asked 6 years ago
Arkadiusz Idzikowski staff answered 6 years ago
Damian Gemza staff answered 5 years ago
Dear @Joao
I have investigated your problem - I've tried to find where this bug has a place. But after some digging in the code I've discovered, that there's no bug. Sticky Directive works fine.
The problem was with your code.
In the main-section.component.html you're having such line:
sticky-after="#navbar"
But you should use there a .navbar selector. I'll describe that why you should use the .navbar selector later. So your sticky-after input should look like the below one:
sticky-after=".navbar"
Explanation: sticky-after input requires to pass a CSS selector, not an angular selector. So in this way you would add id="navbar" to the mdb-navbar element.
But this also will not work, because mdb-navbar element hasn't got a height. So you can't stick element to another element which has no height.
But element which has the .navbar class got height value - to this element you can stick another element.
Best Regards,
Damian
Arkadiusz Idzikowski staff answered 6 years ago
Joao pro answered 6 years ago
Arkadiusz Idzikowski staff answered 6 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: 6.2.3
- Device: PC
- Browser: Firefox
- OS: WIN 7 x64
- Provided sample code: No
- Provided link: No