sticky header bug fixed
This commit is contained in:
@@ -12,28 +12,20 @@ export default function BreadcrumbCom({title, span, paths}) {
|
|||||||
|
|
||||||
// var rect = navRef?.current?.getBoundingClientRect()?.bottom;
|
// var rect = navRef?.current?.getBoundingClientRect()?.bottom;
|
||||||
var rect = 10;
|
var rect = 10;
|
||||||
// window.addEventListener('scroll', ()=>{
|
window.addEventListener('scroll', ()=>{
|
||||||
// if(window.scrollY >= rect + 20){
|
if(window.scrollY >= rect + 20){
|
||||||
// setStickNav(true)
|
setStickNav(true)
|
||||||
// console.log('tru')
|
console.log('tru')
|
||||||
// }else{
|
}else{
|
||||||
// setStickNav(false)
|
setStickNav(false)
|
||||||
// console.log('false')
|
console.log('false')
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
|
|
||||||
// return () => window.removeEventListener('scroll', window.addEventListener('scroll', ()=>{
|
|
||||||
// if(window.scrollY >= rect + 20){
|
|
||||||
// setStickNav(true)
|
|
||||||
// }else{
|
|
||||||
// setStickNav(false)
|
|
||||||
// }
|
|
||||||
// }))
|
|
||||||
},[])
|
},[])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`${stickNav ? 'sticky top-0 transition-[top] duration-1000 shadow-md shadow-black' : '-top-[100px] static'}`}>
|
// ${stickNav ? 'sticky top-0 transition-[top] duration-1000 shadow-md shadow-black' : '-top-[100px] static'}
|
||||||
|
<div className={`sticky -top-10 bg-white-body dark:bg-black-body dark:border-b dark:border-black-box dark:shadow-sm dark:shadow-black-box`}>
|
||||||
<div className= {`w-full py-2 flex justify-between items-center`}>
|
<div className= {`w-full py-2 flex justify-between items-center`}>
|
||||||
<div className='flex flex-col gap-2'>
|
<div className='flex flex-col gap-2'>
|
||||||
<div className='flex flex-col md:flex-row gap-1 md:items-center'>
|
<div className='flex flex-col md:flex-row gap-1 md:items-center'>
|
||||||
|
|||||||
Reference in New Issue
Block a user