$(document).ready(function() { // Home page slider top $("#owl-demo").owlCarousel({ loop:true, autoPlay : 3000, stopOnHover : true, navigation:true, paginationSpeed : 1000, singleItem : true, autoHeight : false, addClassActive : true, pagination:false, rewindSpeed :2500, lazyLoad : true }); $(document).ready(function() { $("#owl-demo2").owlCarousel({ navigation : true, // Show next and prev buttons slideSpeed : 300, paginationSpeed : 400, responsiveClass:true, pagination:false, singleItem:true // "singleItem:true" is a shortcut for: // items : 1, // itemsDesktop : false, // itemsDesktopSmall : false, // itemsTablet: false, // itemsMobile : false }); }); ///fade in down animation ///web Button Drop Down $(window).scroll(function(){ var sticky = $('.sticky'), scroll = $(window).scrollTop(); if (scroll >= 100) sticky.addClass('header-fixed'); else sticky.removeClass('header-fixed'); }); // parallax effect var $animation_elements = $('.animation-element'); var $window = $(window); function check_if_in_view() { var window_height = $window.height(); var window_top_position = $window.scrollTop(); var window_bottom_position = (window_top_position + window_height); $.each($animation_elements, function() { var $element = $(this); var element_height = $element.outerHeight(); var element_top_position = $element.offset().top; var element_bottom_position = (element_top_position + element_height); //check to see if this current container is within viewport if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) { $element.addClass('in-view'); } else { $element.removeClass('in-view'); } }); } $window.on('scroll resize', check_if_in_view); $window.trigger('scroll'); }); $(document).ready(function(){ var native_width = 0; var native_height = 0; //Now the mousemove function $(".magnify").mousemove(function(e){ //When the user hovers on the image, the script will first calculate //the native dimensions if they don't exist. Only after the native dimensions //are available, the script will show the zoomed version. if(!native_width && !native_height) { //This will create a new image object with the same image as that in .small //We cannot directly get the dimensions from .small because of the //width specified to 200px in the html. To get the actual dimensions we have //created this image object. var image_object = new Image(); image_object.src = $(".small").attr("src"); //This code is wrapped in the .load function which is important. //width and height of the object would return 0 if accessed before //the image gets loaded. native_width = image_object.width; native_height = image_object.height; } else { //x/y coordinates of the mouse //This is the position of .magnify with respect to the document. var magnify_offset = $(this).offset(); //We will deduct the positions of .magnify from the mouse positions with //respect to the document to get the mouse positions with respect to the //container(.magnify) var mx = e.pageX - magnify_offset.left; var my = e.pageY - magnify_offset.top; //Finally the code to fade out the glass if the mouse is outside the container if(mx < $(this).width() && my < $(this).height() && mx > 0 && my > 0) { $(".large").fadeIn(100); } else { $(".large").fadeOut(100); } if($(".large").is(":visible")) { //The background position of .large will be changed according to the position //of the mouse over the .small image. So we will get the ratio of the pixel //under the mouse pointer with respect to the image and use that to position the //large image inside the magnifying glass var rx = Math.round(mx/$(".small").width()*native_width - $(".large").width()/2)*-1; var ry = Math.round(my/$(".small").height()*native_height - $(".large").height()/2)*-1; var bgp = rx + "px " + ry + "px"; //Time to move the magnifying glass with the mouse var px = mx - $(".large").width()/2; var py = my - $(".large").height()/2; //Now the glass moves with the mouse //The logic is to deduct half of the glass's width and height from the //mouse coordinates to place it with its center at the mouse coordinates //If you hover on the image now, you should see the magnifying glass in action $(".large").css({left: px, top: py, backgroundPosition: bgp}); } } }) //magnify1 start $(document).ready(function(){ var native_width = 0; var native_height = 0; //Now the mousemove function $(".magnify1").mousemove(function(e){ //When the user hovers on the image, the script will first calculate //the native dimensions if they don't exist. Only after the native dimensions //are available, the script will show the zoomed version. if(!native_width && !native_height) { //This will create a new image object with the same image as that in .small //We cannot directly get the dimensions from .small because of the //width specified to 200px in the html. To get the actual dimensions we have //created this image object. var image_object = new Image(); image_object.src = $(".small1").attr("src"); //This code is wrapped in the .load function which is important. //width and height of the object would return 0 if accessed before //the image gets loaded. native_width = image_object.width; native_height = image_object.height; } else { //x/y coordinates of the mouse //This is the position of .magnify with respect to the document. var magnify_offset = $(this).offset(); //We will deduct the positions of .magnify from the mouse positions with //respect to the document to get the mouse positions with respect to the //container(.magnify) var mx = e.pageX - magnify_offset.left; var my = e.pageY - magnify_offset.top; //Finally the code to fade out the glass if the mouse is outside the container if(mx < $(this).width() && my < $(this).height() && mx > 0 && my > 0) { $(".large1").fadeIn(100); } else { $(".large1").fadeOut(100); } if($(".large1").is(":visible")) { //The background position of .large will be changed according to the position //of the mouse over the .small image. So we will get the ratio of the pixel //under the mouse pointer with respect to the image and use that to position the //large image inside the magnifying glass var rx = Math.round(mx/$(".small").width()*native_width - $(".large").width()/2)*-1; var ry = Math.round(my/$(".small").height()*native_height - $(".large").height()/2)*-1; var bgp = rx + "px " + ry + "px"; //Time to move the magnifying glass with the mouse var px = mx - $(".large1").width()/2; var py = my - $(".large1").height()/2; //Now the glass moves with the mouse //The logic is to deduct half of the glass's width and height from the //mouse coordinates to place it with its center at the mouse coordinates //If you hover on the image now, you should see the magnifying glass in action $(".large1").css({left: px, top: py, backgroundPosition: bgp}); } } }) }) //magnify1 end //magnify2 start $(document).ready(function(){ var native_width = 0; var native_height = 0; //Now the mousemove function $(".magnify2").mousemove(function(e){ //When the user hovers on the image, the script will first calculate //the native dimensions if they don't exist. Only after the native dimensions //are available, the script will show the zoomed version. if(!native_width && !native_height) { //This will create a new image object with the same image as that in .small //We cannot directly get the dimensions from .small because of the //width specified to 200px in the html. To get the actual dimensions we have //created this image object. var image_object = new Image(); image_object.src = $(".small2").attr("src"); //This code is wrapped in the .load function which is important. //width and height of the object would return 0 if accessed before //the image gets loaded. native_width = image_object.width; native_height = image_object.height; } else { //x/y coordinates of the mouse //This is the position of .magnify with respect to the document. var magnify_offset = $(this).offset(); //We will deduct the positions of .magnify from the mouse positions with //respect to the document to get the mouse positions with respect to the //container(.magnify) var mx = e.pageX - magnify_offset.left; var my = e.pageY - magnify_offset.top; //Finally the code to fade out the glass if the mouse is outside the container if(mx < $(this).width() && my < $(this).height() && mx > 0 && my > 0) { $(".large2").fadeIn(100); } else { $(".large2").fadeOut(100); } if($(".large2").is(":visible")) { //The background position of .large will be changed according to the position //of the mouse over the .small image. So we will get the ratio of the pixel //under the mouse pointer with respect to the image and use that to position the //large image inside the magnifying glass var rx = Math.round(mx/$(".small").width()*native_width - $(".large").width()/2)*-1; var ry = Math.round(my/$(".small").height()*native_height - $(".large").height()/2)*-1; var bgp = rx + "px " + ry + "px"; //Time to move the magnifying glass with the mouse var px = mx - $(".large1").width()/2; var py = my - $(".large1").height()/2; //Now the glass moves with the mouse //The logic is to deduct half of the glass's width and height from the //mouse coordinates to place it with its center at the mouse coordinates //If you hover on the image now, you should see the magnifying glass in action $(".large2").css({left: px, top: py, backgroundPosition: bgp}); } } }) }) //magnify2 end //magnify1 start $(document).ready(function(){ var native_width = 0; var native_height = 0; //Now the mousemove function $(".magnify1").mousemove(function(e){ //When the user hovers on the image, the script will first calculate //the native dimensions if they don't exist. Only after the native dimensions //are available, the script will show the zoomed version. if(!native_width && !native_height) { //This will create a new image object with the same image as that in .small //We cannot directly get the dimensions from .small because of the //width specified to 200px in the html. To get the actual dimensions we have //created this image object. var image_object = new Image(); image_object.src = $(".small1").attr("src"); //This code is wrapped in the .load function which is important. //width and height of the object would return 0 if accessed before //the image gets loaded. native_width = image_object.width; native_height = image_object.height; } else { //x/y coordinates of the mouse //This is the position of .magnify with respect to the document. var magnify_offset = $(this).offset(); //We will deduct the positions of .magnify from the mouse positions with //respect to the document to get the mouse positions with respect to the //container(.magnify) var mx = e.pageX - magnify_offset.left; var my = e.pageY - magnify_offset.top; //Finally the code to fade out the glass if the mouse is outside the container if(mx < $(this).width() && my < $(this).height() && mx > 0 && my > 0) { $(".large1").fadeIn(100); } else { $(".large1").fadeOut(100); } if($(".large1").is(":visible")) { //The background position of .large will be changed according to the position //of the mouse over the .small image. So we will get the ratio of the pixel //under the mouse pointer with respect to the image and use that to position the //large image inside the magnifying glass var rx = Math.round(mx/$(".small").width()*native_width - $(".large").width()/2)*-1; var ry = Math.round(my/$(".small").height()*native_height - $(".large").height()/2)*-1; var bgp = rx + "px " + ry + "px"; //Time to move the magnifying glass with the mouse var px = mx - $(".large1").width()/2; var py = my - $(".large1").height()/2; //Now the glass moves with the mouse //The logic is to deduct half of the glass's width and height from the //mouse coordinates to place it with its center at the mouse coordinates //If you hover on the image now, you should see the magnifying glass in action $(".large1").css({left: px, top: py, backgroundPosition: bgp}); } } }) }) //magnify1 end //magnify3 start $(document).ready(function(){ var native_width = 0; var native_height = 0; //Now the mousemove function $(".magnify3").mousemove(function(e){ //When the user hovers on the image, the script will first calculate //the native dimensions if they don't exist. Only after the native dimensions //are available, the script will show the zoomed version. if(!native_width && !native_height) { //This will create a new image object with the same image as that in .small //We cannot directly get the dimensions from .small because of the //width specified to 200px in the html. To get the actual dimensions we have //created this image object. var image_object = new Image(); image_object.src = $(".small3").attr("src"); //This code is wrapped in the .load function which is important. //width and height of the object would return 0 if accessed before //the image gets loaded. native_width = image_object.width; native_height = image_object.height; } else { //x/y coordinates of the mouse //This is the position of .magnify with respect to the document. var magnify_offset = $(this).offset(); //We will deduct the positions of .magnify from the mouse positions with //respect to the document to get the mouse positions with respect to the //container(.magnify) var mx = e.pageX - magnify_offset.left; var my = e.pageY - magnify_offset.top; //Finally the code to fade out the glass if the mouse is outside the container if(mx < $(this).width() && my < $(this).height() && mx > 0 && my > 0) { $(".large3").fadeIn(100); } else { $(".large3").fadeOut(100); } if($(".large3").is(":visible")) { //The background position of .large will be changed according to the position //of the mouse over the .small image. So we will get the ratio of the pixel //under the mouse pointer with respect to the image and use that to position the //large image inside the magnifying glass var rx = Math.round(mx/$(".small").width()*native_width - $(".large").width()/2)*-1; var ry = Math.round(my/$(".small").height()*native_height - $(".large").height()/2)*-1; var bgp = rx + "px " + ry + "px"; //Time to move the magnifying glass with the mouse var px = mx - $(".large3").width()/2; var py = my - $(".large3").height()/2; //Now the glass moves with the mouse //The logic is to deduct half of the glass's width and height from the //mouse coordinates to place it with its center at the mouse coordinates //If you hover on the image now, you should see the magnifying glass in action $(".large3").css({left: px, top: py, backgroundPosition: bgp}); } } }) }) //magnify3 end /*vedio popup*/ $(document).ready(function(){ //Examples of how to assign the Colorbox event to elements $(".group1").colorbox({rel:'group1'}); $(".group2").colorbox({rel:'group2', transition:"fade"}); $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"}); $(".group4").colorbox({rel:'group4', slideshow:true}); $(".ajax").colorbox(); $(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390}); $(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409}); $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"}); $(".inline").colorbox({inline:true, width:"50%"}); $(".callbacks").colorbox({ onOpen:function(){ alert('onOpen: colorbox is about to open'); }, onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); }, onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); }, onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); }, onClosed:function(){ alert('onClosed: colorbox has completely closed'); } }); $('.non-retina').colorbox({rel:'group5', transition:'none'}) $('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true}); //Example of preserving a JavaScript event for inline calls. $("#click").click(function(){ $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here."); return false; }); }); })