top position according to responsive vs. scroll
pete111 opened this issue · 4 comments
pete111 commented
hi, is it possible to adjust top position according to responsive vs scroll mode please?
I would like to use both scrollContainer as well as responsiveContainer, but with specific top position.
something like:
$table.floatThead({
scrollContainer: function($table){
top: 105;
return $table.closest(".wrapper");
},
responsiveContainer: function($table){
top: 55;
return $table.closest(".table-responsive");
}
});
any idea please how could I adjust top position for both modes?
mkoryak commented
Top can be a number or a function that returns top.
Make it be a function and then you just need to figure out which mode
you're in. Possibly check the window clientWidth to determine that.
…On Tue, Feb 28, 2023, 9:37 AM pete111 ***@***.***> wrote:
hi, is it possible to adjust top position according to responsive vs
scroll mode please?
I would like to use both scrollContainer as well as responsiveContainer,
but with specific top position.
something like:
$table.floatThead({
scrollContainer: function($table){
top: 105;
return $table.closest(".wrapper");
},
responsiveContainer: function($table){
top: 55;
return $table.closest(".table-responsive");
}
});
—
Reply to this email directly, view it on GitHub
<#477>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC5WSKAIBBEV3USCZSPXLLWZYEQZANCNFSM6AAAAAAVKZ3TOY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
pete111 commented
Top can be a number or a function that returns top. Make it be a function and then you just need to figure out which mode you're in. Possibly check the window clientWidth to determine that
could you please provide me with example? I am not very familiar with javascript
mkoryak commented
Sure, something like this (i did not run this code):
$table.floatThead({
responsiveContainer: function($table){
return $table.closest(".table-responsive");
},
top: function(){
// use your responsive breakpoint here instead
if(document.body.clientWidth <= 500){
return 55;
} else {
return 105;
}
}
});
mkoryak commented
You're welcome