StickySectionHeaders
Makes headers for sections in lists sticky. Known from the iPhone OS tables views.
Install / Use
/learn @polarblau/StickySectionHeadersREADME
Usage
Basic options
$('#sticky-list').stickySectionHeaders();
Check out the demo here.
Settings and defaults
$('#sticky-list').stickySectionHeaders({
stickyClass : 'sticky',
headlineSelector : 'strong'
});
HTML
<div id="sticky-list">
<ul>
<li>
<strong>Section Headline 1</strong>
<ul>
<li>Content line</li>
<li>Content line</li>
<li>Content line</li>
<li>Content line</li>
</ul>
</li>
<li>
<strong>Section Headline 2</strong>
<ul>
<li>Content line</li>
<li>Content line</li>
</ul>
</li>
<li>
<strong>Section Headline 4</strong>
<ul>
<li>Content line</li>
<li>Content line</li>
<li>Content line</li>
<li>Content line</li>
</ul>
</li>
</ul>
</div>
CSS
/* Reset some list defaults for all lists */
ul {
list-style: none;
margin: 0;
padding: 0;
}
/* The main container */
#sticky-list {
height: 100px;
overflow: hidden;
position: relative;
}
/* The main list */
#sticky-list > ul {
height: 100%;
overflow: auto;
}
/* Section headers, defined through "headlineSelector" */
#sticky-list > ul > li strong {
display: block;
}
/* Section headers when "sticky", defined through "stickyClass" */
#sticky-list > ul > li.sticky strong {
position: absolute;
top: 0;
}
Related Skills
node-connect
340.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.1kCommit, push, and open a PR
