1///////////////////////////////////////////////////////\\ 2///////////////////////////////////////////////////////\\ 3//***************************************************\\\\ 4// JQuery Float Dialog v1.0 \\\\ 5// Easy PopUp \\\\ 6// ExpBuilder \\\\ 7// [email protected] \\\\ 8//***************************************************\\\\ 9///////////////////////////////////////////////////////\\ 10///////////////////////////////////////////////////////\\ 11jQuery.fn.floatdialog = function(id, options) 12{ 13 var Config = { 14 backgroundcolor: "#000000", 15 speed : 'slow', 16 event : 'click', 17 effect : true, 18 move : 'default', 19 closeClass : '.closebutton' 20 }; 21 if(options) 22 { 23 jQuery.extend(Config, options); 24 }; 25 26 //functions 27 //{ 28 function brwstester() 29 { 30 return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body; 31 } 32 33 function resizeheights(me) 34 { 35 36 $("#" + me).css({'height' : $(window).height() + brwstester().scrollTop + "px"}); 37 } 38 function display_mask(id) 39 { 40 if(Config.effect) 41 { 42 $("#floatdialog_mask_" + id).show().fadeTo(Config.speed, 0.33); 43 } 44 else 45 { 46 $("#floatdialog_mask_" + id).css({opacity: '0.33'}).show(); 47 } 48 } 49 50 function center_form(id) 51 { 52 var scwidth = screen.width; 53 var scheight = screen.height; 54 var tblwidth = $("#" + id).width(); 55 var tblheight = $("#" + id).height(); 56 57 var D_width = (scwidth - tblwidth); 58 if(D_width > 0) 59 { 60 D_width /= 2; 61 } 62 else if(D_width < 0) 63 { 64 D_width *= -1; 65 D_width /= 2; 66 } 67 $("#" + id).css('left', D_width + 'px'); 68 69 var D_height = (scheight - tblheight); 70 if(D_height > 0) 71 { 72 D_height /= 2; 73 } 74 else if(D_height < 0) 75 { 76 D_height *= -1; 77 D_height /= 2; 78 } 79 $("#" + id).css('top', brwstester().scrollTop + D_height /2 + 'px'); 80 } 81 82 function display_form(id) 83 { 84 display_mask(id); 85 center_form(id); 86 $(window).scroll(function() 87 { 88 center_form(id); 89 }); 90 91 if(Config.move == 'down') 92 { 93 //move from up 94 var top = document.getElementById(id).style.top; 95 $("#" + id).css({'top': (brwstester().scrollTop - 100) + 'px'}).show().animate({"top": top}, Config.speed); 96 } 97 else if(Config.move == 'up') 98 { 99 //move from down 100 var top = document.getElementById(id).style.top; 101 $("#" + id).css({'top': (brwstester().scrollTop + (screen.height)) + 'px'}).show().animate({"top": top}, Config.speed); 102 } 103 else if(Config.move == 'right') 104 { 105 //move from left 106 var left = document.getElementById(id).style.left; 107 $("#" + id).css({'width': $("#" + id).width(), 'left': screen.width + 'px'}).show().animate({"left": left}, Config.speed); 108 } 109 else if(Config.move == 'left') 110 { 111 //move from right 112 var left = document.getElementById(id).style.left; 113 $("#" + id).css({'width': $("#" + id).width(), 'left': '-' + $("#" + id).width() + 'px'}).show().animate({"left": left}, Config.speed); 114 } 115 else if(Config.move == 'slidedown') 116 { 117 118 $("#" + id).slideDown(Config.speed); 119 } 120 else 121 { 122 //default 123 if(Config.effect) 124 { 125 $("#" + id).fadeIn(Config.speed); 126 } 127 else 128 { 129 $("#" + id).show(); 130 } 131 } 132 } 133 function disable_mask(id) 134 { 135 $(".disable_masking").hide(); 136 if(Config.effect) 137 { 138 $("#floatdialog_mask_" + id).fadeOut(Config.speed).fadeTo("", 100); 139 } 140 else 141 { 142 $("#floatdialog_mask_" + id).hide(); 143 } 144 } 145 //} 146 $(document).ready(function() 147 { 148 if(!$("#floatdialog_mask_" + id).html()) 149 { 150 $("body").append('<div id="floatdialog_mask_' + id + '" style="display: none;left: 0px;top: 0px;z-index: 6000;position: absolute;background-color:' + Config.backgroundcolor + '"> </div>'); 151 $("#floatdialog_mask_" + id).css({'width' : screen.availWi
151dth + "px"}).bind('click', function() 152 { 153 disable_mask(id); 154 }); 155 resizeheights('floatdialog_mask_' + id); 156 if(Config.closeClass) 157 { 158 $(Config.closeClass).bind('click', function() 159 { 160 disable_mask(id); 161 }); 162 } 163 } 164 165 }); 166 $("#" + id).hide().addClass('disable_masking'); 167 $(window).scroll(function() 168 { 169 resizeheights('floatdialog_mask_' + id); 170 }); 171 $(this).bind(Config.event, function() 172 { 173 display_form(id); 174 }); 175 176}
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.