Victa / curtain.js

PROJECT IS NOT MAINTAINED - This plugin allows you to create a web page with multiple fixed panels that unroll with an amusing effect.

Home Page:http://curtain.victorcoulon.fr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add back to top menu button?

DESIGNfromWITHIN opened this issue · comments

How about adding a back top top (first slide) button?

You can.

Simply add an id attribute to your first 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:

<a href="#myfirstpanel" class="myawesomelink">Go to first panel</a>

I am sorry, but this not seem to work...
It only works the first time, the the #myfirstpanel is added to the URL and the link does not work anymore...

Maybe use jQuery to remove #myfirstpanel from the URL just after the link is clicked?

Fixed and I have also added a new option to Curtain.js

Example:

Your curtains list :

<ol class="curtains">
    <li id="myfirstpanel" class="cover"> 
        your content
    </li>
    [...]
</ol>

And your link with a specific class used by the plugin :

<a href="#myfirstpanel" class="curtain-links">Go to first panel</a>

And to launch the plugin with the new option:

$(function () {
    $('.curtains').curtain({
        scrollSpeed: 600,
        controls: '.menu',
        curtainLinks: '.curtain-links'
    });
});

Be careful, I have renamed the option 'menu' to 'controls' and delete the jQuery selector ...

wooow Thanks thanks thanks!