Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function( $ ) {
- $(window).load(function() {
- $('.flexslider').flexslider({
- animation: "slide",
- controlNav: false,
- directionNav: false,
- });
- });
- //Change Main image size on load
- var $windowheight = $(window).height();
- $('#top-content').css('height', $windowheight );
- $('.play-button img').css('margin-top', $windowheight/2 - 75 );
- $('.video').css('margin-top', $windowheight/2 - 140 );
- $(window).resize(function() {
- //Change Main image size on window resize
- var $windowheight = $(window).height();
- $('#top-content').css('height', $windowheight );
- $('.play-button img').css('margin-top', $windowheight/2 - 75 );
- $('.video').css('margin-top', $windowheight/2 - 140 );
- });
- $( '#contact-form-holder' ).click(function() {
- $( this ).toggleClass( 'closed' );
- $( '#contact-form' ).toggleClass( 'closed' );
- });
- //Change Phone Numbers off of URL Parameters
- var url = jQuery(window.location).attr("href");
- var a = $('<a>' { href:url })[0];
- var last_url = getQuery(a);
- var hash_url = getHash(a);
- //console.log(last_url);
- if ( last_url == 'campaign=seo' ) {
- $('.phone a').text('404-490-4078');
- $('.phone a').attr('href', 'tel:4044904078');
- }
- if (last_url == 'campaign=sem') {
- $('.phone a').text('404-490-4115');
- $('.phone a').attr('href', 'tel:4044904115');
- }
- if (last_url != '') {
- $("a").each(function() {
- var link = $(this).attr('href');
- var path = link.split('#')[0];
- var hash = link.split('#')[1];
- //console.log( "query: " + queryString );
- console.log( path + '?' + last_url + '#' + hash );
- $(this).attr ( 'href', path + '?' + last_url + '#' + hash );
- });
- }
- //Stop youtube video on close
- $('#stop').on('click', function() {
- //$('#popup-youtube-player').stopVideo();
- $('#popup-youtube-player')[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
- $('.video').css('display' , 'none');
- $('.play-button').css('display' , 'block');
- });
- //Check for contact form and Menu styles on scrolling
- $(window).scroll(function() {
- //var styledDiv = $('#contact-form'),
- var targetScroll = $('#services').position().top,
- currentScroll = $('html').scrollTop() || $('body').scrollTop();
- //styledDiv.toggleClass('closed', currentScroll + 100 >= targetScroll);
- $('header').toggleClass('blue', currentScroll + 100 >= targetScroll);
- });
- //Play button function
- $('.play-button').click(function() {
- $('.play-button').css('display', 'none');
- $('.video').css('display' , 'block');
- });//www.youtube.com/embed/kS2EFX4UHWk?rel=0
- //Mobile Menu Open and Close
- $('#showMmenu, #mm_nav li a' ).click(function() {
- if ( $('#mm_nav').hasClass( 'open-menu')) {
- $('#mm_nav').removeClass('open-menu');
- $('#showMmenu').removeClass('open-menu');
- $('#showMmenu').html('Menu');
- } else {
- $("#mm_nav").addClass('open-menu');
- $('#showMmenu').addClass('open-menu');
- $('#showMmenu').html('X');
- }
- });
- //Reset button closes contact form
- $('.reset').click(function(){
- $( '#contact-form-holder' ).toggleClass( 'closed' );
- $( '#contact-form' ).toggleClass( 'closed' );
- });
- $("a#inline").fancybox({
- 'hideOnContentClick': true
- });
- // Youtube fancy box
- $('.iframe').fancybox();
- });
- function getHash(url) {
- //
- // var hash = url.split("#")[1];
- var hash = url.hash;
- console.log( "hash: " + hash );
- return hash;
- }
- function getQuery(url) {
- //var url_array = url.split('?');
- //var last_url = url_array[url_array.length - 1];
- var query = url.search;
- return query;
- }
- function writeURL(url){
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement