//page preloader $(window).load(function() { $("#loader").delay(500).fadeout(); $(".mask").delay(1000).fadeout("slow"); }); $(document).ready(function(){ //sticky navigation $("#navigation").sticky({topspacing:0}); //leaving page fade out $('a.external').click(function(){ var url = $(this).attr('href'); $('.mask').fadein(250, function(){ document.location.href = url; }); $("#loader").fadein("slow"); return false; }); }); //back to top $(function() { $('a#back-top').click(function () { $('html, body').stop().animate({ scrolltop: 0 }, 1500,'easeinoutexpo'); }); }); //navigation scrolling $(function() { $('.nav a, .nav li a, #home-center a, a.move, .dizhimeun a').bind('click',function(event){ var $anchor = $(this); $('html, body').stop().animate({ scrolltop: $($anchor.attr('href')).offset().top -44 }, 1500,'easeinoutexpo'); event.preventdefault(); }); }); //prettyphoto $(function(){ $("a[rel^='prettyphoto']").prettyphoto({ opacity: 0.5, social_tools: "", deeplinking: false }); }); //parallax $(window).bind('load', function () { parallaxinit(); }); function parallaxinit() { $('#twitter-parallax').parallax("30%", 0.1); $('#quote-parallax').parallax("30%", 0.1); $('#contact-parallax').parallax("30%", 0.1); $('#home.parallax').parallax("30%", 0.1); $('#project-counters').parallax("30%", 0.1); $('#aboutus').parallax("30%", 0.1); $('#about_job').parallax("30%", 0.1); $('#about_hzhb').parallax("30%", 0.1); /*add as necessary*/ } //bxslider $(document).ready(function(){ var onmobile = false; if( /android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.useragent) ) { onmobile = true; } $('.fullwidth-slider').bxslider({ /*auto:true,*/ mode:"fade", speed:1000, /* pause:5000,*/ pager: false, onslidebefore: function($slideelement) { ($slideelement).find('.slide-caption').fadeout().animate({top:'100px'},{queue:false, easing: 'easeoutquad', duration: 550}); ($slideelement).find('.slide-caption').hide().animate({top:'-100px'}); }, onslideafter: function($slideelement) { ($slideelement).find('.slide-caption').fadein().animate({top:'0'},{queue:false, easing: 'easeoutquad', duration: 450}); }, }); $('.bx-wrapper .bx-controls-direction a').attr('data-500','top:83%; opacity: 0;').attr('data-start','top:50%; opacity: 1;'); if( ( onmobile === false ) && ( $('.parallax-slider').length ) ) { skrollr.init({ edgestrategy: 'set', smoothscrolling: false, forceheight: false }); } $('.news-slider').bxslider({ pagercustom: '#news-pager', controls:false, auto:true, pause:5000, }); $('.clients-slider').bxslider({ pagercustom: '#bx-pager', controls:false, auto:true, }); $('.project-slider').bxslider({ controls: true, pager: false, auto:true, pause: 3000, preloadimages:'all', }); $('.blog-slider').bxslider({ controls: true, pager: false, auto:false, pause: 3000, preloadimages: 'visible', }); $('.text-slide-vertical').bxslider({ controls: false, adaptiveheight: true, pager: false, auto:true, mode:'fade', pause: 5000, }); }); //navigation dropdown $('.nav a.colapse-menu1').click(function () { $(".nav-collapse").collapse("hide") }); $('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stoppropagation(); }); // accordion $('dl.accordion dt').filter(':first-child').addclass('accordion-active'); $('dd.accordion-content').filter(':nth-child(n+3)').addclass('hide'); $('dl.accordion').on('click', 'dt', function() { $(this) .addclass('accordion-active') .next() .slidedown(200) .siblings('dd.accordion-content') .slideup(200) .prev() .removeclass('accordion-active'); }); // tabs $(".tab_container").hide(); //hide all content $("ul.tabs li:first").addclass("tab-active").show(); //activate first tab $(".tab_container:first").show(); //show first tab content $("ul.tabs li").click(function() { $("ul.tabs li").removeclass("tab-active"); //remove any "active" class $(this).addclass("tab-active"); //add "active" class to selected tab $(".tab_container").hide(); //hide all tab content var activetab = $(this).find("a").attr("href"); //find the rel attribute value to identify the active tab + content $(activetab).fadein(); //fade in the active content return false; }); // toggle $(".toggle_container").hide(); $("span.toggle-title").click(function(){ $(this).toggleclass("toggle-active").next().slidetoggle("normal"); return false; }); $(document).ready(function(){ //elements fading $('.element_from_top').each(function () { $(this).appear(function() { $(this).delay(150).animate({opacity:1,top:"0px"},1000); }); }); $('.element_from_bottom').each(function () { $(this).appear(function() { $(this).delay(150).animate({opacity:1,bottom:"0px"},1000); }); }); $('.element_from_left').each(function () { $(this).appear(function() { $(this).delay(150).animate({opacity:1,left:"0px"},1000); }); }); $('.element_from_right').each(function () { $(this).appear(function() { $(this).delay(150).animate({opacity:1,right:"0px"},1000); }); }); $('.element_fade_in').each(function () { $(this).appear(function() { $(this).delay(150).animate({opacity:1,right:"0px"},1000); }); }); //animated progress bars $('.bar li').each(function () { $(this).appear(function() { $(this).animate({opacity:1,left:"0px"},1200); var b = $(this).find("span").attr("data-width"); $(this).find("span").animate({ width: b + "%" }, 1700, "easeoutcirc"); }); }); //animated counters $('.counters').each(function () { $(".timer .count").appear(function() { var counter = $(this).html(); $(this).countto({ from: 0, to: counter, speed: 2000, refreshinterval: 60, }); }); }); //fading out alertbox $('.shortcode_alertbox').find('.box_close').click(function(){ $(this).parents('.alertboxes').animate({opacity:0},300).animate({height:"0px"}); }); }); $(window).load(function(){ //masonry blog var $container = $('.blog-posts-content'); $container.isotope({ masonry: { }, animationoptions: { duration: 750, easing: 'linear', queue: false, }, }); //google map var latlng = new google.maps.latlng(45.738028,21.224535); var settings = { zoom: 16, center: new google.maps.latlng(45.738028,21.224535), maptypeid: google.maps.maptypeid.roadmap, maptypecontrol: false, scrollwheel: false, draggable: true, maptypecontroloptions: {style: google.maps.maptypecontrolstyle.dropdown_menu}, navigationcontrol: false, navigationcontroloptions: {style: google.maps.navigationcontrolstyle.small}, maptypeid: google.maps.maptypeid.roadmap}; var map = new google.maps.map(document.getelementbyid("map_canvas"), settings); google.maps.event.adddomlistener(window, "resize", function() { var center = map.getcenter(); google.maps.event.trigger(map, "resize"); map.setcenter(center); }); var contentstring = '
'+ '
'+ '
'+ '

newave

'+ '
'+ '

here we are. come to drink a coffee!

'+ '
'+ '
'; var infowindow = new google.maps.infowindow({ content: contentstring }); var companyimage = new google.maps.markerimage('webimages/marker.png', new google.maps.size(58,63), new google.maps.point(0,0), new google.maps.point(35,20) ); var companypos = new google.maps.latlng(45.738028,21.224535); var companymarker = new google.maps.marker({ position: companypos, map: map, icon: companyimage, title:"creative news", zindex: 3}); google.maps.event.addlistener(companymarker, 'click', function() { infowindow.open(map,companymarker); }); }); jquery(document).ready(function($){ // portfolio isotope var container = $('#portfolio-wrap'); container.isotope({ animationengine : 'best-available', animationoptions: { duration: 200, queue: false }, layoutmode: 'fitrows' }); $('#filters a').click(function(){ $('#filters a').removeclass('active'); $(this).addclass('active'); var selector = $(this).attr('data-filter'); container.isotope({ filter: selector }); setprojects(); return false; }); function splitcolumns() { var winwidth = $(window).width(), columnnumb = 1; if (winwidth > 1600){ columnnumb = 4; }else if (winwidth > 1024) { columnnumb = 4; } else if (winwidth > 767) { columnnumb = 2; } else if (winwidth > 479) { columnnumb = 2; } else if (winwidth < 479) { columnnumb = 1; } return columnnumb; } function setcolumns() { var winwidth = $(window).width(), columnnumb = splitcolumns(), postwidth = math.floor(winwidth / columnnumb); container.find('.portfolio-item').each(function () { $(this).css( { width : postwidth + 'px' }); }); } function setprojects() { setcolumns(); container.isotope('relayout'); } container.imagesloaded(function () { setcolumns(); }); $(window).bind('resize', function () { setprojects(); }); var $timeline_block = $('.cd-timeline-block'); //hide timeline blocks which are outside the viewport $timeline_block.each(function(){ if($(this).offset().top > $(window).scrolltop()+$(window).height()*0.75) { $(this).find('.cd-timeline-img, .cd-timeline-content').addclass('is-hidden'); } }); //on scolling, show/animate timeline blocks when enter the viewport $(window).on('scroll', function(){ $timeline_block.each(function(){ if( $(this).offset().top <= $(window).scrolltop()+$(window).height()*0.75 && $(this).find('.cd-timeline-img').hasclass('is-hidden') ) { $(this).find('.cd-timeline-img, .cd-timeline-content').removeclass('is-hidden').addclass('bounce-in'); } }); }); }); //expander slider function initbxmodal() { $('.project-slider').bxslider({ controls: true, pager: false, auto:true, pause: 3000, preloadimages:'all', }); }; //fullscreen slider $(function (){ $('#fullscreen-slider').maximage({ cycleoptions: { fx: 'fade', speed: 1000, // has to match the speed for css transitions in jquery.maximage.css (lines 30 - 33) timeout: 5000, prev: '#slider_left', next: '#slider_right', pause: 0, before: function(last,current){ jquery('.slide-content').fadeout().animate({top:'100px'},{queue:false, easing: 'easeoutquad', duration: 550}); jquery('.slide-content').fadeout().animate({top:'-100px'}); }, after: function(last,current){ jquery('.slide-content').fadein().animate({top:'0'},{queue:false, easing: 'easeoutquad', duration: 450}); } }, onfirstimageloaded: function(){ jquery('#cycle-loader').delay(800).hide(); jquery('#fullscreen-slider').delay(800).fadein('slow'); jquery('.slide-content').fadein().animate({top:'0'}); jquery('.slide-content a').bind('click',function(event){ var $anchor = $(this); jquery('html, body').stop().animate({ scrolltop: $($anchor.attr('href')).offset().top -44 }, 1500,'easeinoutexpo'); event.preventdefault(); }); } }); // helper function to fill and center the html5 video //jquery('video,object').maximage('maxcover'); jquery('object').maximage('maxcover'); // to show it is dynamic html text }); $(window).load(function() { // project page expander (function(){ var container = $( "#project-page-holder" ); var $items = $('#portfolio-wrap .open-project-link'); index = $items.length; $('#portfolio-wrap .open-project-link').click(function(){ if ($(this).hasclass('active')){ } else { lastindex = index; index = $(this).index(); $items.removeclass('active'); $(this).addclass('active'); var myurl = $(this).find('.open-project').attr("href") + " .item-data"; $('#project-page-data').animate({opacity:0}, 400,function(){ $("#project-page-data").load(myurl,function(e){ var $helper = $('.helper'); var height = $helper.height(); $('#project-page-data').css("min-height", height); $('.project-slider').css({'height' : ''}); $('#maximage').css({'height' : ''}); $('#maximage').maximage({ cycleoptions: { fx: 'fade', speed: 1000, // has to match the speed for css transitions in jquery.maximage.css (lines 30 - 33) timeout: 6000, prev: '#arrow_left', next: '#arrow_right', pause: 1, }, }); }); $('#project-page-data').delay(400).animate({opacity:1}, 400); }); $('html, body').animate({ scrolltop: $(".portfolio-bottom").offset().top -40}, 900); //project page open $('#project-page-holder').slideup(600, function(){ $('#project-page-data').css('visibility', 'visible');}).delay(1100).slidedown(1000,function(){ $('#project-page-data').fadein('slow',function(){initbxmodal();}); $('.element_fade_in').each(function () { $(this).appear(function() { $(this).delay(100).animate({opacity:1,right:"0px"},1000); }); }); }); } return false; }); //project page close $(document).on('click', '#project_close', function(event) { $('#project-page-data').animate({opacity:0}, 400,function(){ $('#project-page-holder').delay(400).slideup(400); }); $('html, body').delay(1000).animate({ scrolltop: $(".portfolio-top").offset().top - 70}, 800); $items.removeclass('active') ; return false; }); })(); }); $(window).load(function() { document.getelementbyid("all").click(); });