$(document).ready(function(){
// disable href="#" links
$('a').click(function(){if ($(this).attr('href') == '#') {return false;}});
$('a').live('click', function(){if ($(this).attr('href') == '#') {return false;}});
// tooltip
$("a[rel^='tooltip']").tooltip();
//prettyphoto
$('a[data-rel]').each(function() {
$(this).attr('rel', $(this).data('rel'));
});
$("a[rel^='prettyphoto']").prettyphoto();
//menu
jquery('#menu > ul').superfish({
delay: 0,
animation: {
opacity:'show',
height:'show'
},
speed: 'fast',
autoarrows: false
});
(function() {
var $menu = $('#menu ul'),
optionslist = '';
$menu.find('li').each(function() {
var $this = $(this),
$anchor = $this.children('a'),
depth = $this.parents('ul').length - 1,
indent = '';
if( depth ) {
while( depth > 0 ) {
indent += ' - ';
depth--;
}
}
optionslist += '';
}).end().after('');
$('.res-menu').on('change', function() {
window.location = $(this).val();
});
})();
//flickr widget footer
$('#footer .flickr').jflickrfeed({
limit: 8,
qstrings: {
id: '36621592@n06'
},
itemtemplate: ''+
'
'+
'' +
'' +
'' +
'' +
''
}, function(data) {
$("a[rel^='prettyphoto']").prettyphoto();
});
//flickr widget sidebar
$('#sidebar .sidebar-flickr').jflickrfeed({
limit: 8,
qstrings: {
id: '36621592@n06'
},
itemtemplate: ''+
''+
'' +
'' +
'' +
'' +
''
}, function(data) {
$("a[rel^='prettyphoto']").prettyphoto();
});
//portfolio
var $portfolioclone = $(".filtrable").clone();
$("#filtrable a").live('click', function(e){
$("#filtrable li").removeclass("current");
var $filterclass = $(this).parent().attr("class");
var $filteredportfolio = $portfolioclone.find("article");
if ( $filterclass == "all" ) {
$filteredportfolio = $portfolioclone.find("article");
} else {
$filteredportfolio = $portfolioclone.find("article[data-type~=" + $filterclass + "]");
}
$(".filtrable").quicksand( $filteredportfolio, {
duration: 800,
easing: 'easeoutquint'
}, function(){
$("a[rel^='prettyphoto']").prettyphoto();
});
$(this).parent().addclass("current");
e.preventdefault();
});
// to top button
$(function(){
$().uitotop({ easingtype: 'easeoutquart' });
});
});
$(window).load(function() {
// slider
$("#mainslider").flexslider({
animation: "slide",
slideshow: false, // ***
usecss: false,
controlnav: true,
animationloop: false,
smoothheight: true
});
// accordion settings
$(function() {
$('.accordion').on('show', function (e) {
$(e.target).prev('.accordion-heading').find('i').removeclass('icon-plus');
$(e.target).prev('.accordion-heading').find('i').addclass('icon-minus');
});
$('.accordion').on('hide', function (e) {
$(e.target).prev('.accordion-heading').find('i').removeclass('icon-minus');
$(e.target).prev('.accordion-heading').find('i').addclass('icon-plus');
});
});
});