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

Sticky headers without caption #322

Closed
Harmonium opened this issue Jun 3, 2013 · 12 comments
Closed

Sticky headers without caption #322

Harmonium opened this issue Jun 3, 2013 · 12 comments

Comments

@Harmonium
Copy link

Hi,

Is it possible to have sticky headers without caption ?

Regards,

FG

@TheSin-
Copy link
Collaborator

TheSin- commented Jun 3, 2013

Add this CSS

table.containsStickyHeaders caption {
  display: none;
}

That should do it.

@Harmonium
Copy link
Author

It works but the effect is really bad. The headers are duplicated at some times.

@TheSin-
Copy link
Collaborator

TheSin- commented Jun 3, 2013

it's all in CSS, try add a background to the table.containsStickyHeaders so it covers up and isn't transparent. This will hide everything that passes behind it.

@Mottie
Copy link
Owner

Mottie commented Jun 3, 2013

@Harmonium Hmm, I think you're right (demo), I'll just add an option to the sticky headers widget to include or not include the caption.

Thanks @TheSin- for helping :)

@TheSin-
Copy link
Collaborator

TheSin- commented Jun 3, 2013

I know you are busy ATM so I'm just trying to help where I can till you return ;) Without code changes since that it out of my control ;)

@Mottie Mottie closed this as completed in eb48e66 Jun 5, 2013
@Harmonium
Copy link
Author

Hi,

Thanks for the fix but I still have strange effects. As soon as the scroll passes the caption, the headers are duplicated. Take a look here : http://testersitefg.no-ip.info:8082/4DACTION/W_ListeDesJoueurs/

@TheSin-
Copy link
Collaborator

TheSin- commented Jun 5, 2013

this seems like a very small over sight, I'll find the issue and post the patch for you in a few minutes, just need my morning java first ;)

@TheSin-
Copy link
Collaborator

TheSin- commented Jun 5, 2013

Okay here you go, works perfectly for me now. looks like outerHeight was required to get the true height, and I just simplified the check by adding it to the offset rather then twice in the compare. Hope this helps ya

jquery.tablesorter.widgets.js line 1208

offset = $t.offset(),
cap = -(wo.stickyHeaders_includeCaption ? 0 : $t.find('caption').height()),
sTop = $win.scrollTop() + stickyOffset,
tableHt = $t.height() - ($stickyTable.height() + (tfoot.height() || 0)),
vis = (sTop > offset.top - cap) && (sTop < offset.top - cap + tableHt) ? 'visible' : 'hidden';

to

offset = $t.offset(),
cap = (wo.stickyHeaders_includeCaption ? 0 : $t.find('caption').outerHeight(true)),
sTop = $win.scrollTop() + stickyOffset - cap,
tableHt = $t.height() - ($stickyTable.height() + (tfoot.height() || 0)),
vis = (sTop > offset.top) && (sTop < offset.top + tableHt) ? 'visible' : 'hidden';

@Harmonium
Copy link
Author

Great ! It is working now ! Thanks to you !

Do you know when it will be officially released ?

FG

@TheSin-
Copy link
Collaborator

TheSin- commented Jun 5, 2013

Mottie is on leave for a few months I'm sure he'll fix it once he is back, I'm just trying to help him out while he is away.

From README.md and on the code page

I'll be on sabbitical starting June 5, 2013 for approximately 2-3 months. So, sadly, I won't be able to fix any problems or add enhancements until I return. And I will return :)

@TheSin-
Copy link
Collaborator

TheSin- commented Jun 6, 2013

if you put it all in a div you could use index(), or you coul djust check $(this).html() and parse it. I hate to go into more detail here since it has nothing to do with this ticket. If you'd like email me directly at gmail, thesin.

@TheSin-
Copy link
Collaborator

TheSin- commented Jun 10, 2013

This fix is now in git, so it will be included in the next release.

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

3 participants