Untitled
By: a guest | Mar 18th, 2010 | Syntax:
JavaScript | Size: 1.19 KB | Hits: 50 | Expires: Never
// execute your scripts when the DOM is ready. this is a good habit
$(document).ready(function() {
// initialize scrollable
var api = $(".project-scroll").scrollable(
{
easing: 'swing',
clickable: false,
size: '1',
items: '#project-wrapper',
loop: 'true',
prev: '#btn-prev-project',
next: '#btn-next-project',
keyboard: false,
speed: 800
}).navigator({api:true});
// Starte Funktion vor dem Scrolling zum nächsten Projekt
api.onBeforeSeek(function() {
// check if details are visible
// when visible -> slideUp()
if($('#projekt-details:visible')){
$('#projekt-details').slideUp();
}
});
// var currentIndex = $("#projekt-details").scrollable().getIndex();
// Setup handler on click auf Projekt
$('.project').bind("click", show_details);
});
function show_details(which) {
// first load current content
// second slideout the details-container
// var currentIndex = $("#projekt-details").scrollable().getIndex();
currentIndex = $(this).index();
alert(currentIndex);
// slide out
$('#projekt-details').slideToggle();
setTimeout("$.scrollTo('500','0');",500);
}