Ajax – Coda Slider Effect
The tutorial Coda Slider Effect by jQuery for Designers has been followed. A few changes have been done to the file coda-slider.js to meet the demands of the theme.
Changes done
In this part of the code, the following has been added “width: 946px” to meet the demands of the theme.
// collect the scroll object, at the same time apply the hidden overflow
// to remove the default scrollbars that will appear
var $scroll = $('#slider .scroll').css(
'overflow': 'hidden'
,'width': '946px');
In the demo the images of the buttons can be found at http://demo.wpesp.com/portfolio/wp-content/uploads/scroll_left.png, This part should be published using the url address chosen for your buttons, as for example http://yoururl.com/wp-content/uploads/scroll_left.png.
// apply our left + right buttons
$scroll
.before('<img class="scrollButtons left" src="http://demo.wpesp.com/portfolio/wp-content/uploads/scroll_left.png" alt="Left button" />')
.after('<img class="scrollButtons right" src="http://demo.wpesp.com/portfolio/wp-content/uploads/scroll_right.png" alt="Right button" />');
Part of the original code has been deleted, because our theme does not use this navigation. The example of jQuery for Designers corresponds to the top navigation.
// handle nav selection
function selectNav() {
$(this)
.parents('ul:first')
.find('a')
.removeClass('selected')
.end()
.end()
.addClass('selected');
}
$('#slider .navigation').find('a').click(selectNav);
// go find the navigation link that has this target and select the nav
function trigger(data) {
var el = $('#slider .navigation').find('a[href$="' + data.id + '"]').get(0);
selectNav.call(el);
}
if (window.location.hash) {
trigger({ id : window.location.hash.substr(1) });
} else {
$('ul.navigation a:first').click();
}
The following lines corresponding to the previous navigator have also been deleted.
navigation: '.thumb a', onAfter: trigger, // our final callback

27-12-2008 at %I:%M %p