Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: add extra class to the top floated element when its active #461

Closed
adam-jones-net opened this issue Oct 23, 2020 · 3 comments
Closed

Comments

@adam-jones-net
Copy link

adam-jones-net commented Oct 23, 2020

Just an idea that would have helped me if it was possible out of the box;

It would be really useful for external css styling if when the table header becomes sticky an additional class is added to the code that the function produces in the dom for the sticky header (ie the same element with the class floatThead-container).

Btw, I've seen the example of the 'floated' event at http://mkoryak.github.io/floatThead/
So kind of like that but by default and on the floated header, not the original main table as that example does.

@mkoryak
Copy link
Owner

mkoryak commented Oct 23, 2020

Ok, you can do that with what already exists like this:

var $table = $('table.demo2');
$table.on("floatThead", function(e, isFloated, $floatContainer){
    $floatContainer.toggleClass("floated", isFloated);
});
$table.floatThead(...);

Does this work for what you want to do or did I misunderstand your question?

@adam-jones-net
Copy link
Author

Ah excellent yes thats what im after yes. I just thought it could be nice also to add it by default to this element too.

@mkoryak
Copy link
Owner

mkoryak commented Oct 24, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants