1/***************************/ 2//@Author: Adrian "yEnS" Mato Gondelle 3//@website: www.yensdesign.com 4//@email: [email protected] 5//@license: Feel free to use it, but keep this credits please! 6/***************************/ 7 8//SETTING UP OUR POPUP 9//0 means disabled; 1 means enabled; 10var popupStatus = 0; 11 12var QUALE_POP = "#backgroundPopup"; 13var QUALE_CONTACT = "#popupContact"; 14 15 16//loading popup with jQuery magic! 17function loadPopup(){ 18 //loads popup only if it is disabled 19 if(popupStatus==0){ 20 $(QUALE_POP).css({ 21 "opacity": "0.7" 22 }); 23 $(QUALE_POP).fadeIn("slow"); 24 $(QUALE_CONTACT).fadeIn("slow"); 25 popupStatus = 1; 26 } 27} 28 29 30//disabling popup with jQuery magic! 31function disablePopup(){ 32 //disables popup only if it is enabled 33 if(popupStatus==1){ 34 $(QUALE_POP).fadeOut("slow"); 35 $(QUALE_CONTACT).fadeOut("slow"); 36 popupStatus = 0; 37 } 38} 39 40//centering popup 41function centerPopup(){ 42 //request data for centering 43 var windowWidth = document.documentElement.clientWidth; 44 var windowHeight = document.documentElement.clientHeight; 45 var popupHeight = $(QUALE_CONTACT).height(); 46 var popupWidth = $(QUALE_CONTACT).width(); 47 //centering 48 $(QUALE_CONTACT).css({ 49 "position": "absolute", 50 "top": windowHeight/2-popupHeight/2, 51 "left": windowWidth/2-popupWidth/2 52 }); 53 //only need force for IE6 54 55 $(QUALE_POP).css({ 56 "height": windowHeight 57 }); 58 59} 60 61 62//CONTROLLING EVENTS IN jQuery 63$(document).ready(function() { 64 65 //LOADING POPUP 66 //Click the button event! 67 $("#button").click(function() { 68 QUALE_POP = "#backgroundPopup"; 69 QUALE_CONTACT = "#popupContact"; 70 71 //centering with css 72 centerPopup(); 73 //load popup 74 loadPopup(); 75 }); 76 77 $("#button2").click(function() { 78 //centering with css 79 QUALE_POP = "#backgroundPopup2"; 80 QUALE_CONTACT = "#popupContact2"; 81 centerPopup(); 82 //load popup 83 loadPopup(); 84 }); 85 86 //CLOSING POPUP 87 //Click the x event! 88 $("#popupContactClose").click(function() { 89 QUALE_POP = "#backgroundPopup"; 90 QUALE_CONTACT = "#popupContact"; 91 disablePopup(); 92 }); 93 $("#popupContactClose2").click(function() { 94 QUALE_POP = "#backgroundPopup2"; 95 QUALE_CONTACT = "#popupContact2"; 96 disablePopup(); 97 }); 98 //Click out event! 99 $(QUALE_POP).click(function() { 100 disablePopup(); 101 }); 102 //Press Escape event! 103 $(document).keypress(function(e) { 104 if (e.keyCode == 27 && popupStatus == 1) { 105 disablePopup(); 106 } 107 }); 108 109});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.