Curtain.js
PROJECT IS NOT MAINTAINED. This plugin allows you to create a web page with multiple fixed panels that unfold with an amusing effect.
Install / Use
/learn @Victa/Curtain.jsREADME
Curtain.js (The plugin is no longer maintained)
This plugin allows you to create a web page with multiple fixed panels that unroll with an amusing effect. Exactly like a curtain rises.
To navigate, you can use your keyboard instead the scrollbar or mousewheel to navigate into the document. But that's not all, there is more features! For example, you can easily add a fixed element or multiple "steps" element inside a pannel.
Feel free to fork the project on github or ping me on twitter for any comments.
<a href='http://www.pledgie.com/campaigns/17333'><img alt='Click here to lend your support to: Curtain.js and make a donation at www.pledgie.com !' src='http://www.pledgie.com/campaigns/17333.png?skin_name=chrome' border='0' /></a>
Demonstrations
Site using Curtain.js
- http://sports.espn.go.com/espn/eticket/story?page=Dock-Ellis
- http://womenandtech.com/
- http://iconic-furniture.com/
- http://btpdesign.com/
Documentation
Basic Usage
Usage is very straightforward, simply include curtain.js file in the page, along with jQuery.
<script src="js/libs/jquery.js"></script>
<script src="js/libs/curtain.js"></script>
And don't forget to add the base stylesheet
<link rel="stylesheet" href="curtain.css">
Then call $('.curtains').curtain(); to launch the plugin. You can add a set of optional options.
Options
Valid options for curtain.js are:
scrollSpeed- Adjust the scroll speed (default400)menu- Bind event on "up" or "down" button (defaultnull)curtainLinks- If you want add a<a>(or multiple) link to a specific panel simply add a class name to this option. Take a look of the example bellow.(default'.curtain-links')enableKeys- Enable/Disable keyboard navigation (defaulttrue)easing- Change this option to specify the easing function used by jQuery animate calls. (defaultsswing) (You muse use jQuery easing plugin or similar to have more easing functions)
Example
Setup the correct element structure:
<ol class="curtains">
<li class="cover">
your content
</li>
<li>
<div class="fixed"> <!-- if you need a "fixed" content -->
a fixed content
</div>
[...]
</li>
<li class="cover">
[...]
</li>
<li >
<ul>
<li class="step"> ... </li> <!-- Add the class "step" to an element to -->
<li class="step"> ... </li> <!-- make a break at this point with keyboard controls -->
</ul>
</li>
</ol>
Then, you can launch the plugin:
$(function () {
$('.curtains').curtain({
scrollSpeed: 400
});
});
Features
Add a "next" and "prev" link
Insert your menu in your html document. You must use href="#up" and href="#down".
<ul class="menu">
<li><a href="#up">↑</a></li>
<li><a href="#down">↓</a></li>
</ul>
Then, you can launch the plugin and specify the class of your menu.
$(function () {
$('.curtains').curtain({
scrollSpeed: 400,
controls: '.menu'
});
});
Add a link to a specific panel
Simply add an id attribute to your panel:
<ol class="curtains">
<li id="myfirstpanel" class="cover">
your content
</li>
[...]
</ol>
Then you can add a link anywhere to your first panel like:
<ol class="curtains">
[...]
<li class="cover">
<a href="#myfirstpanel" class="curtain-links">Go to first panel</a>
</li>
</ol>
Then, you can launch the plugin and specify the class of your links.
$(function () {
$('.curtains').curtain({
scrollSpeed: 400,
curtainLinks: '.curtain-links'
});
});
Add callbacks to slide change events
You can fire a callback when the slide changes
$('.curtains').curtains({
nextSlide: function() { console.log('next slide'); },
prevSlide: function() { console.log('previous slide')}
});
Compatibility
- Safari
- Firefox
- Chrome
- IE8/IE9
- iOs (iPhone/iPad) but the curtain effect is disabled
- Android (Chrome/Opera) but the curtain effect is disabled
Roadmap
- Remove panels dynamically
- Better android default browser support
- scroll horizontally
Credits
Author
Victor Coulon or ping me on twitter http://twitter.com/_victa
Contributors
Inspirations
- http://editsquarterly.com/
- http://www.interviewmagazine.com
- http://www.dbworks.pro/
- http://www.deuxhuithuit.com/en/
- http://www.madebygrave.com/
- http://www.boston.com/bigpicture/
Licence
Licence MIT
Related Skills
node-connect
337.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.3kCreate 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
337.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.3kCommit, push, and open a PR
