/** To make your life easier, all the scripts that are loaded once the DOM has fully loaded have been written here. These scripts are linked to the Practica Theme @ ThemeForest.net by Christopher 'crozer' Honninger **/ $(document).ready(function() { /* ///// start DOM ready ///// */ $("img.imageBlock").css({"position" : "absolute"}); /** Hover effect **/ $("img.imageBlock").hover( function() { $(this).stop().animate({"opacity": "0"}, "slow"); }, function() { $(this).stop().animate({"opacity": "1"}, "slow"); }); /** Portfolio Categories Slide **/ $('.trigger').click(function() { var $marginLefty = $(this).next(); $marginLefty.animate({ marginLeft: parseInt($marginLefty.css('marginLeft'),10) === 0 ? -$marginLefty.outerWidth() : 0 }); }); /** Portfolio Description Hide/show **/ $(".descr").hover(function() { $(this).hide(); }, function() { $(this).show(); }); /** jTruncator **/ $('.descrText').jTruncate({ length: 100, minTrail: 0, moreText: '[..]' }); $('.descrTitle').jTruncate({ length: 20, minTrail: 0, moreText: '..' }); /** About Social Info (Rotating Plus Hover effect) **/ $(".idOne").hover(function() { $(".aboutMoreContentDone1").delay(400).fadeIn("fast"); $(".triggerAbout1").animate({ rotate: '-=90deg', opacity:1 }, 400); }, function() { $(".triggerAbout1").delay(400).animate({ opacity: 0 }, "fast"); $(".aboutMoreContentDone1").fadeOut("fast"); }); $(".triggerAbout1").click(function() { var $marginLefty = $(this).next(); $marginLefty.animate({ marginLeft: parseInt($marginLefty.css('marginLeft'),10) === 0 ? -$marginLefty.outerWidth() : 0 }, function() { $(this).addClass("aboutMoreContentDone1"); $(this).mouseleave(function() { /**/ }); }); }); $(".idTwo").hover(function() { $(".aboutMoreContentDone2").delay(400).fadeIn("fast"); $(".triggerAbout2").animate({ rotate: '-=90deg', opacity:1 }, 400); }, function() { $(".triggerAbout2").delay(400).animate({ opacity: 0 }, "fast"); $(".aboutMoreContentDone2").fadeOut("fast"); }); $(".triggerAbout2").click(function() { var $marginLefty = $(this).next(); $marginLefty.animate({ marginLeft: parseInt($marginLefty.css('marginLeft'),10) === 0 ? -$marginLefty.outerWidth() : 0 }, function() { $(this).addClass("aboutMoreContentDone2"); $(this).mouseleave(function() { /**/ }); }); }); $(".idThree").hover(function() { $(".aboutMoreContentDone3").delay(400).fadeIn("fast"); $(".triggerAbout3").animate({ rotate: '-=90deg', opacity:1 }, 400); }, function() { $(".triggerAbout3").delay(400).animate({ opacity: 0 }, "fast"); $(".aboutMoreContentDone3").fadeOut("fast"); }); $(".triggerAbout3").click(function() { var $marginLefty = $(this).next(); $marginLefty.animate({ marginLeft: parseInt($marginLefty.css('marginLeft'),10) === 0 ? -$marginLefty.outerWidth() : 0 }, function() { $(this).addClass("aboutMoreContentDone3"); $(this).mouseleave(function() { /**/ }); }); }); /** Pretty Photo **/ $("a[rel^='prettyPhoto']").prettyPhoto({ allow_resize: true, theme: 'facebook' /* light_rounded / dark_rounded / light_square / dark_square / facebook */ }); /** jQZoom **/ $('.zoomedImage').jqzoom({ }); /** .info Scroll Pane **/ $('li.info').jScrollPane({ scrollbarOnLeft : true, dragMinHeight : 10 }); }); /* ///// end DOM ready ///// */ /** Nivo slider start-up and settings **/ $(window).load(function() { $('#slider').nivoSlider({ effect:'random', //Specify sets like: 'fold,fade,sliceDown' slices:15, animSpeed:500, //Slide transition speed pauseTime:3000, startSlide:0, //Set starting Slide (0 index) directionNav:false, //Next and Prev directionNavHide:false, //Only show on hover controlNav:true, //1,2,3... controlNavThumbs: false, //Use thumbnails for Control Nav controlNavThumbsFromRel:false, //Use image rel for thumbs controlNavThumbsSearch: '.jpg', //Replace this with... controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src keyboardNav:true, //Use left and right arrows pauseOnHover:true, //Stop animation while hovering manualAdvance:false, //Force manual transitions captionOpacity:0.8, //Universal caption opacity beforeChange: function(){}, afterChange: function(){}, slideshowEnd: function(){} //Triggers after all slides have been shown }); });