Changeset 11961 for extensions/Autosize/js
- Timestamp:
- Aug 16, 2011, 3:27:53 PM (13 years ago)
- Location:
- extensions/Autosize/js
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/js/Affiche_script.js
r11912 r11961 2 2 function Toggle_bp() { 3 3 cl_visible = !cl_visible; 4 set_cl(); 5 jQuery().newResize(); 6 Wait_Affichage(); 7 } 8 function set_cl(){ 9 if (typeof cl_visible == "undefined") return; 10 4 11 if (cl_visible) src = src1; 5 12 else src = src2; … … 10 17 jQuery('#bp_cla').attr('title', src_info); 11 18 12 jQuery('#bp_img_cla').get(0).src = src; 19 jQuery('#bp_cla').attr('Stitle', src_info); 20 jQuery('#bp_cla').attr('Stip', " "); 21 22 bp_scr = jQuery('#bp_img_cla'); 23 24 if (bp_scr.length > 0) { 25 bp_scr.get(0).src = src; 13 26 jQuery('#bp_img_cla').attr('alt', src_info); 14 27 jQuery('#bp_img_cla').attr('title', src_info); 15 jQuery('#bp_cla').attr('Stitle', src_info);16 jQuery('#bp_cla').attr('Stip', " "); 17 jQuery().newResize();28 } 29 30 18 31 19 32 } … … 53 66 //========================================================================== 54 67 function Wait_Affichage() { 68 href = location.href; 69 70 jQuery.post(href, function (data) { }); 71 // alert("Data Loaded: " + data); 72 if (typeof fade_in == "undefined") fade_in = 1000; 55 73 fade_in = parseInt(fade_in); 74 /* 56 75 if (!jQuery().newResize()) { 57 76 setTimeout("Wait_Affichage()", 500); 58 77 return 59 78 } 79 */ 60 80 nu_img++; 61 81 if (typeof fade_in == "undefined") fade_in = 0; 62 82 if (fade_in == 0) { 63 83 jQuery(Parent).css({ opacity: "1" }); … … 78 98 } 79 99 // if (nu_img > 1) return; 80 81 100 if (typeof theImg == "undefined") return true; 101 if (theImg == null) return; 102 103 if (jQuery(theImg).length > 0) { 104 105 106 stb.stop().fadeTo(3500, 0); 82 107 83 108 img_h = jQuery(theImg).height(); 84 109 img_w = jQuery(theImg).width(); 85 86 110 jQuery("#src_img_h").val(img_h); 87 111 jQuery("#src_img_w").val(img_w); … … 101 125 window_width: Window_Affichage.width 102 126 }); 103 104 127 } 128 105 129 } 106 130 107 131 //===================================================================== 108 132 old_window = { width: 0, height: 0 }; 109 133 List_autosize = new Array(); 110 134 function Autosize_resize(Obj) { 111 if (typeof cl_visible != "undefined") return;112 113 135 114 136 conf = jQuery(Obj).get(0).conf; … … 127 149 conf.MargeHaute 128 150 ); 129 130 151 info_Obj = jQuery(Obj).infos(); 131 152 h1_left = jQuery(Obj).absoluteLeft(); … … 136 157 else 137 158 h1 = (myWindow.height - marge_basse); 138 139 140 159 rap = info_Obj.height / info_Obj.width; 141 160 w2 = parseInt(h1 / rap); 142 143 161 if (w2 < info_Obj.width) 144 162 marginLeft = info_Obj.left + parseInt((info_Obj.width - w2) / 2) + "px"; 145 163 else 146 164 marginLeft = "auto"; 147 148 165 jQuery(Obj).css({ width: "auto", marginTop: marge_top, 149 166 marginLeft: "auto", marginBottom: 0 + "px", … … 151 168 }); 152 169 jQuery(Obj).height(h1); 153 154 170 //============================================================= 155 if (conf.ResizePicture != "true") { 156 157 } else 158 imgs = jQuery(Obj).find("img"); 171 if (conf.ResizePicture == "true") 172 imgs = jQuery(Obj).find("img"); 173 else 174 imgs = jQuery(Obj).find("img"); 175 Parent = Obj; 176 159 177 Obj_w = jQuery(Obj).width(); 160 178 Obj_h = jQuery(Obj).height(); 161 179 if (imgs.length>0) { 162 180 jQuery(imgs).each(function (i) { 163 181 img = jQuery(this); 164 165 info_img = { width: conf.width[i], height: conf.height[i] }; 182 h1_top = jQuery(img).absoluteTop() - h1_top; 183 h1_bottom = Obj_h - h1_top; 184 info_img = { width: conf.width[i], height: conf.height[i] }; //origine 166 185 img_rap = conf.rap[i]; 167 168 186 if (info_img.width > Obj_w) h1 = parseInt(Obj_w / img_rap); 169 else w2 = parseInt(Obj_h * img_rap); 187 h1 -= h1_top; 188 if (h1 > Obj_h - h1_top) { 189 h1 = Obj_h-h1_top; 190 } 191 w2 = parseInt(h1 * img_rap); 170 192 if (w2 > 0 && h1 > 0 && img.length > 0) { 171 193 img.height(h1); 172 194 img.width(w2); 173 195 } 174 175 196 }); 176 177 178 197 }else{ 198 imgs = jQuery(Obj).children(); 199 jQuery(imgs).each(function (i) { 200 if (this.height > 0) { 201 h1_top = jQuery(this).absoluteTop() - h1_top; 202 h1_bottom = Obj_h - h1_top; 203 info_img = { width: conf.width[i], height: conf.height[i] }; //origine 204 img_rap = conf.rap[i]; 205 if (info_img.width > Obj_w) h1 = parseInt(Obj_w / img_rap); 206 h1 -= h1_top; 207 if (h1 > Obj_h - h1_top) { 208 h1 = Obj_h - h1_top; 209 } 210 w2 = parseInt(h1 * img_rap); 211 if (w2 > Obj_w ) { 212 w2 = Obj_w; 213 } 214 215 if (w2 > 0 && h1 > 0 ) { 216 this.height=(h1); 217 this.width=(w2); 218 } 219 220 } 221 name = this.name; 222 }); 223 224 225 226 } 179 227 180 228 } 229 //=============================================== 230 // Extend expression 231 //=============================================== 181 232 jQuery.extend(jQuery.expr[':'], { 182 233 // Nom du sélecteur personnalisé 183 234 Autosize: function (a) { 235 nd = a.nodeName; 184 236 n1 = a.className; 185 237 // personal_block 186 238 if (n1.match(RegExp("autosize", "gi"))) { 187 // autoresize = "MargeBasse:30px; ResizePicture:false"239 // autosize = "MargeBasse:30px; ResizePicture:false" 188 240 infconf = jQuery(a).attr("autosize"); 189 241 n1 = typeof infconf; … … 201 253 width = new Array(); 202 254 height = new Array(); 255 if (imgs.length > 0) 203 256 jQuery(imgs).each(function (i) { 204 257 img = jQuery(this); … … 207 260 height.push(img.height()); 208 261 }); 262 else { 263 imgs = jQuery(a).children(); 264 jQuery(imgs).each(function (i) { 265 if (this.height>0) { 266 rap.push(this.width / this.height); 267 width.push(this.width); 268 height.push(this.height); 269 } 270 name = this.name; 271 272 273 }); 274 } 209 275 210 276 conf['rap'] = rap; … … 213 279 214 280 List_autosize.push({ obj: a, conf: conf }); 215 jQuery(a).css({ opacity: 1});281 jQuery(a).css({ opacity:0 }); 216 282 } 217 283 } 218 284 // Css = jQuery(a).getStyles(a); 219 220 285 return false; 221 286 287 }, 288 Set_Class: function (a) { 289 nd = a.nodeName; 290 if (nd == "DIV") { 291 XBrowserAddHandler(a,'onpropertychange', onPropertyChange); 292 //jQuery(a).find("img:nth-child(1)").css("border","Solid 5px green"); 293 img = jQuery(a).children("img"); 294 if (img.length == 0) img = jQuery(a).find("a").children("img"); 295 if (img.length > 0) 296 if (img.length == 1) { 297 if (img[0].src.match(RegExp(".png", "g"))) 298 return; 299 // img[0].attachEvent('onpropertychange', onPropertyChange); 300 XBrowserAddHandler(img[0],'onpropertychange', onPropertyChange); 301 jQuery(img).addClass("Image"); 302 //jQuery(img).attr("autosize", "MargeBasse:0px; ResizePicture:true"); 303 } 304 } 222 305 } 223 306 }); 224 307 function XBrowserAddHandler(target,eventName,handlerName){ 308 if ( target.addEventListener ) 309 target.addEventListener(eventName, handlerName, false); 310 else if ( target.attachEvent ) 311 target.attachEvent("on" + eventName, handlerName); 312 else 313 target["on" + eventName] = handlerName; 314 } 315 /* 316 var y = 3; 317 var txtTestBox = document.getElementById('testBox'); 318 XBrowserAddHandler(txtTestBox, 'keyup', function() { 319 myFunctionRef(y) 320 }); 321 var myFunctionRef = function myFunction(x, e) { 322 var keyCode; 323 if (!e && window.event) 324 e = window.event; 325 if (e) 326 keyCode = (window.Event) ? e.which : e.keyCode; 327 alert('You pressed: ' + keyCode + '. Event object is :' + e + '. x is: ' + x); 328 } 329 */ 330 function onPropertyChange(e) { 331 var el = e.srcElement; 332 attributs = el.attributes; 333 if (attributs.id) id = attributs.id.value; 334 if (attributs.style) style = attributs.style.value; 335 /* Image */ 336 if (attributs.src) { 337 src = attributs.src.value; 338 if (attributs.width) width = attributs.width.value; 339 if (attributs.height) height = attributs.height.value; 340 } 341 switch (e.propertyName) { 342 case "style.opacity": 343 344 break; 345 case "style.transform": 346 347 break; 348 case "style.display": 349 350 break; 351 case "style.color": 352 353 break; 354 case "style.width": 355 width= el.style.width; 356 break; 357 case "style.height": 358 height = el.style.height; 359 break; 360 361 case 'width': 362 363 break; 364 case 'height': 365 366 el.style.height = el.attributes.height.nodeValue + 'px'; 367 el.firstChild.style.height = el.clientHeight + 'px'; 368 break; 369 } 370 } 225 371 226 372 function List_autosize_resize(event, ui) { … … 234 380 } 235 381 wait_resize = false; 382 return true; 236 383 237 384 } … … 240 387 function (jQuery) { 241 388 jQuery(':Autosize'); 242 243 389 jQuery(window).unload(function () { 244 390 try { 245 if (t heImg) {391 if (typeof theImg != "undefined") { 246 392 jQuery.cookie('img', theImg.src); // créer un cookie avec une valeur 393 247 394 jQuery.cookie('img_h', jQuery(theImg).height()); 248 395 jQuery.cookie('img_w', jQuery(theImg).width()); 396 397 if (typeof Window_Affichage != "undefined") { 249 398 jQuery.cookie('window_height', Window_Affichage.height); 250 399 jQuery.cookie('window_width', Window_Affichage.width); 251 400 } 401 } 252 402 } catch (r) { 253 403 … … 256 406 }); 257 407 258 259 408 /******************************************** 409 * window LOAD 410 ********************************************/ 260 411 jQuery(window).load(function () { 412 jQuery(':Set_Class'); 261 413 if (typeof img_width == "undefined") { 262 414 if (List_autosize.length == 0) return; 263 for (i = 0; i < List_autosize.length; i++) { 264 Autosize_resize(jQuery(List_autosize[i])); 265 } 266 return; 415 wait_resize = false; 416 if (List_autosize_resize()) Wait_Affichage(); 417 return true; 267 418 } 268 269 270 419 //========================================================= 271 420 if (typeof (options) == "undefined") { … … 303 452 304 453 Parent = "#theImage"; 305 454 var info_theImage = jQuery(Parent).infos(); 306 455 Zone_Affichage = jQuery(Parent).infos(); 307 456 // … … 314 463 if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top; 315 464 else Bandeau = 0; 316 old_window = { width: 0, height: 0 };317 jQuery("#theImage").trigger('ON');318 465 319 466 old_window = { width: 0, height: 0 }; 320 467 jQuery().newResize(); 321 322 //=================================================================== 323 /* 324 * window .resize 325 */ 326 jQuery(window).resize( 327 function (event, ui) { 328 jQuery().newResize(); 329 }); 468 jQuery("#theImage").trigger('ON'); 469 330 470 331 471 //============== initialisation =================== … … 337 477 }); // window.onload 338 478 339 /* Extension 340 * affiche_debug 341 342 * resize 343 * : 344 */ 345 //========================================================= 479 480 /*********************************************************** 481 * RESIZE 482 ***********************************************************/ 346 483 old_window = { width: 0, height: 0 }; 347 484 jQuery(window).resize( 348 485 function (event, ui) { 349 486 List_autosize_resize(event, ui); 350 jQuery().newResize(); 487 if (jQuery().newResize()) 488 Wait_Affichage(); 351 489 }); 352 490 491 /************************************ 492 * Extend 493 ************************************/ 353 494 jQuery.fn.extend({ 354 495 //========================================================== … … 359 500 //============================================================= 360 501 onPropertyChange: function (e) { 502 361 503 return; 362 363 504 364 505 }, … … 376 517 newResize: function () { 377 518 // 378 if (typeof options != undefined) 519 set_cl(); 520 if (typeof options != "undefined") 379 521 if (options.imageAutosize) 380 522 return true; //stripped … … 388 530 jQuery(bp1).trigger('ON'); 389 531 } 390 if (typeof cl_visible == "undefined") return ;532 if (typeof cl_visible == "undefined") return true; 391 533 if (!cl_visible == true) { return true; } 392 534 var chk = eval(user_status + "_enabled"); … … 407 549 408 550 jQuery(Parent).width(winwidth); 409 // jQuery(Parent).height(winheight);410 551 411 552 var Cadre = jQuery(Parent).get(0); 412 var info_theImage = jQuery(Cadre).infos();553 413 554 //=============== Information cadre ====== 414 555 var info_the_page = jQuery("#the_page").infos(); … … 425 566 var marge_right = 0; 426 567 var marge_left = 0; 568 569 var Licence = jQuery(".licencetag"); 570 info_Licence = jQuery(".licencetag").infos(); 571 572 if (typeof Type_Img == 'undefined') { 573 574 } 575 576 577 // jQuery(".licencetag").addClass('imageComment'); 578 579 hd_click = jQuery("#theImage a[href]"); 580 if (hd_click.length > 0) { 581 hd_click = hd_click[0]; 582 if (hd_click.href.match(RegExp("phpWGOpenWindow", "gi"))) { 583 584 hd_click = jQuery("#theImage p"); 585 jQuery(hd_click).addClass('imageComment'); 586 jQuery(hd_click).wrapAll('<div id="_Comment2" />'); 587 } 588 } 589 590 if(jQuery('#_Comment, ').length==0) 591 jQuery('.imageComment, ').wrapAll('<div id="_Comment" />'); 592 427 593 if (theme.match(RegExp("simple", "g"))) { 428 594 if (info_ToolBar.width > 0) … … 463 629 marge_left += Zone_Affichage.borderwidth.left; 464 630 winwidth -= (marge_right + marge_left); 465 //---------------------------------------------466 /*467 jQuery(Parent).width(winwidth); // 1.6.2468 jQuery(Parent).css({ height: "auto" }); //1.6.2469 */470 // jQuery(Parent).height(Zone_Affichage.height);471 //---------------------------------------------472 631 473 632 if (Type_Img == "pamoorama") { … … 525 684 526 685 case "panorama": 527 // return ;686 // return true; 528 687 529 688 //the theMainImage ?? 689 if (!theImg) { 530 690 theImg = jQuery("#theMainImage"); 691 if (theImg.length > 0) 692 return; 693 theImg = jQuery().Get_Img_Maxi("#Panorama img[alt]"); 694 // return; 531 695 if (theImg.length > 0) 532 696 theImg = theImg[0]; 533 697 else 534 698 theImg = jQuery().Get_Img_Maxi("#Panorama img[alt]"); 699 } 535 700 info_theImage = jQuery(theImg).infos(); 536 701 info_the_page = jQuery("#the_page").infos(); … … 589 754 img_reelle.width = parseInt(info_img.width); 590 755 } 591 592 756 break 593 757 case "pamoorama": … … 693 857 info_Licence = jQuery(".licencetag").infos(); 694 858 695 jQuery(Parent + " #theImg IMG").css("marginTop", "0px") 859 jQuery(Parent + " #theImg IMG").css("marginTop", "0px"); 696 860 //========== Correction en fonction du thème ============================= 697 861 var correction = 0; … … 725 889 726 890 h = (Zone_Affichage.padding.bottom + Zone_Affichage.padding.top + Zone_Affichage.margin.top + Zone_Affichage.margin.bottom); 727 728 891 if (typeof Bandeau_t != "undefined") Bandeau = Bandeau_t.img_top|0; 729 892 Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction - h; … … 735 898 //========================================================================= 736 899 if (typeof (Bandeau_bas) != "undefined") { 737 Zone_Affichage.height -= (Bandeau_bas.height + Bandeau_bas.marge.top|0 + Bandeau_bas.marge.bottom|0);900 if (Bandeau_bas.height < Zone_Affichage.height) Zone_Affichage.height -= (Bandeau_bas.height + Bandeau_bas.marge.top + Bandeau_bas.marge.bottom); 738 901 } else { 739 902 } … … 833 996 } 834 997 if (theImg.src) { 835 836 837 998 wingbo = img_finale.width; 838 999 heightgbo = img_finale.height; … … 901 1062 jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" }); 902 1063 } 903 jQuery("#theImage").height(heightgbo + marges_llgbo / 2);1064 // jQuery("#theImage").height(heightgbo + marges_llgbo / 2); 904 1065 } 905 1066 } … … 916 1077 img_finale.width = parseInt(img_finale.width); 917 1078 //========================================================================= 918 if (jQuery("#slideshow").infos().width > 0) { 919 920 921 } else { 922 923 } 1079 924 1080 //=== cadre = theImage 925 1081 jQuery(Cadre).css({ marginLeft: "auto" }); … … 930 1086 img_finale.height = info_theImage.height; 931 1087 Zone_Affichage.height = img_finale.height; 932 jQuery(Cadre).height(Zone_Affichage.height); 1088 933 1089 } 934 1090 … … 973 1129 jQuery("#embedplayer").css("height", img_finale.height); 974 1130 1131 jQuery("embed").css("height", img_finale.height); 1132 1133 jQuery("video").height(img_finale.height); 1134 jQuery("video").width(img_finale.width); 1135 1136 jQuery("video").css({ height: img_finale.height+"px" }); 1137 jQuery("object").css({ height: img_finale.height+"px" }); 975 1138 976 1139 jQuery("object").width(img_finale.width); … … 981 1144 982 1145 jQuery(Cadre).css("height", "auto"); 1146 } else if (Type_Img == "embed") { 1147 1148 jQuery(Cadre).css("height", "auto"); 1149 jQuery("embed").css("height", img_finale.height); 1150 jQuery("object").css({ height: img_finale.height + "px" }); 1151 1152 jQuery("object").width(img_finale.width); 1153 jQuery("object").height(img_finale.height); 983 1154 984 1155 } else if (Type_Img == "panorama") { 985 // ----- jQuery(theImg).panorama2(img_finale.height, img_finale.width);986 // jQuery(theImg).height(img_finale.height);987 // jQuery(theImg).width(img_finale.width);988 // n = jQuery.fn.panorama();989 // jQuery("#Panorama div").height(img_finale.height);990 // class=simple_panorama991 // jQuery("#Panorama div").height(img_finale.height);992 1156 if (typeof asp_options != "undefined") 993 1157 n = asp_options; 994 1158 n1 = jQuery("#Panorama div").width(); 995 // asp_options.viewport_width = winwidth;996 //n =n.panorama_animate();997 //jQuery("#panoramaContainer").stop(); ;998 // n = jQuery(theImg).panorama(asp_options);999 1000 //jQuery("#Panorama div").width(asp_options.viewport_width);1001 1002 1159 jQuery(".panorama-viewport").css("margin", "auto"); 1003 1004 1160 n = info_imageToolBar; 1005 1161 … … 1059 1215 info_frame = jQuery(myPamoorama.frame).infos(); 1060 1216 1061 zoom = img_finale.height / img_height;1062 1217 1063 1218 … … 1073 1228 } else { 1074 1229 //===map ? luciano === 1075 1076 // jQuery(Cadre).height(Zone_Affichage.height + Bandeau_bas.height); //??1077 // jQuery(Cadre).height(img_finale.height + Bandeau_bas.height); //??1078 jQuery(Cadre).css("height","auto"); //??1079 1230 jQuery(theImg).height(img_finale.height); 1080 1231 jQuery(theImg).width(img_finale.width); … … 1149 1300 1150 1301 } 1302 zoom = img_finale.height / img_height; 1303 1304 zoom = parseInt(zoom * 100); 1305 jQuery('#zoom ').val(zoom); 1306 jQuery('#bp_cla').text(zoom + "%"); 1307 1151 1308 // --- réglage de la hauteur de page en fonction du copyright----------- 1152 1309 if (typeof (pos_copyright) == "undefined") pos_copyright = jQuery("#copyright").infos(); … … 1156 1313 if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px"); 1157 1314 } else { 1158 if (pos_copyright.top > 100) { 1159 // jQuery("#the_page").height(pos_copyright.top); 1160 } 1315 1161 1316 } 1162 1317 … … 1171 1326 info_frame = jQuery(Cadre).infos(); 1172 1327 if (theme.match(RegExp("stripped", "gi"))) { 1173 pos = "absolute";1174 1328 info_theImageBox = jQuery("#theImageAndTitle").infos(); 1175 1329 p1 = jQuery(".randomButtons").infos(); … … 1216 1370 1217 1371 return true; 1218 1219 1220 1221 1222 1223 1372 //_____________________________________________________ 1224 1373 } // Resize(); … … 1254 1403 if (!this.src.match(RegExp(thumbnail, "g"))) { 1255 1404 myImg = this; 1405 jQuery( myImg).addClass("Image"); 1256 1406 w00 = w0; 1257 1407 } … … 1270 1420 1271 1421 info_imageToolBar = jQuery("#imageToolBar").infos(); 1272 if (typeof (marge_top) != "undefined") return info_imageToolBar;1422 if (typeof (marge_top) != "undefined") return result; 1273 1423 1274 1424 if (info_imageToolBar.position == "absolute") { … … 1282 1432 1283 1433 jQuery("#" + "theImgContainer").css("marginTop", "0px"); 1434 info_thePicturePage = jQuery("#thePicturePage").infos(); 1284 1435 info_theImage = jQuery(Parent).infos(); 1285 info_thePicturePage = jQuery("#thePicturePage").infos();1286 1287 1288 1436 if (theme.match(RegExp("stripped", "gi"))) { 1289 1290 1437 info_theImageAndTitle = jQuery("#theImageAndTitle").infos(); 1291 1438 info_theImageBox = jQuery("#theImageBox").infos(); 1292 1293 1439 optiontop = (marges_llgbo / 2) + info_theImageAndTitle.margin.top; 1294 1295 1440 } 1296 1441 … … 1317 1462 1318 1463 img_top = Math.ceil(info_theImage.top + 1464 info_theImage.padding.top + 1319 1465 info_theImage.borderwidth.top + 1320 1466 info_thePicturePage.margin.top + optiontop); … … 1326 1472 //=== Afficher le titre de l'image sur le cadre === 1327 1473 llgboh2 = jQuery("#gboh2").infos(); 1328 result.img_top += llgboh2.height; 1329 1474 llgbo = jQuery("#gbo").infos(); 1475 1476 if (llgboh2.top > 0) 1477 result.img_top = llgboh2.top - (llgboh2.height * 2); 1478 else if (marges_llgbo > 0) 1479 result.img_top -= (8); 1480 1481 1330 1482 return result; 1331 1483 … … 1338 1490 //==================================================== 1339 1491 function Info_Description_f(Parent) { 1340 1341 1342 1492 jQuery(Parent).css({ display: "block" }); 1343 1493 //====== détection du type d'images ====== 1344 1494 if (jQuery("#charlie").length > 0) { 1345 1495 Type_Img = "charlie"; 1346 1496 jQuery("#charlie").css({ 1497 paddingTop: "0px", 1498 marginTop: "0px", 1499 paddingBottom: "10px", 1500 marginBottom: "0px" 1501 }); 1502 1503 } else if (jQuery("#Panorama").length) { 1504 Type_Img = "panorama"; 1347 1505 } else if (jQuery("#pamoorama").length) { 1348 1506 Type_Img = "pamoorama"; … … 1386 1544 } 1387 1545 1388 Bandeau_t = Info_entete(Parent) 1546 Bandeau_t = Info_entete(Parent); 1547 1389 1548 Bandeau = Bandeau_t.img_top; 1390 1391 1549 info_theImgContainer = jQuery("#" + "theImgContainer").infos(); 1392 1550 info_description = jQuery("#" + "description").infos(); … … 1428 1586 1429 1587 } else if (jQuery("#charlie").length > 0) { 1430 1588 info_charlie = jQuery("#charlie").infos(); 1431 1589 if (jQuery("object").attr("type") == 'application/x-shockwave-flash') { 1432 1590 jQuery("#charlie").css({ … … 1447 1605 info_img = jQuery(theImg).infos(); 1448 1606 1607 1449 1608 } else if (jQuery(Parent + " embed").length > 0) { 1450 1609 1451 1610 theImg = jQuery(Parent + " embed"); 1611 1452 1612 info_img = jQuery(theImg).infos(); 1453 1613 jQuery(Parent + " embed").width({ width: info_img.width+"px", height: info_img.height + "px" }); 1454 1614 1455 1615 … … 1474 1634 if (theImg.length > 1) 1475 1635 {theImg = theImg[0]; 1476 1477 1636 } 1478 1637 … … 1547 1706 info_description.marge.top = -2; 1548 1707 } 1549 info_description.bottom = info_theImage.bottom; 1550 info_description.top = info_img.height + info_theImage.top ;1708 info_description.bottom = info_theImage.bottom; //482 1709 info_description.top = info_img.height + info_theImage.top ; //410+62 1551 1710 // info_description.bottom -= info_img.top; 1552 1711 } … … 1640 1799 jQuery('#pamoorama').live('ON', function (e) { 1641 1800 jQuery(jQuery('.debug').get(1)).trigger('ON'); 1801 if (typeof Bandeau_bas=="undefined" || Bandeau_bas.width == 0) { 1642 1802 Bandeau_bas = Info_Description_f(Parent); 1643 1803 Bandeau = Bandeau_bas.top; 1644 1804 old_window = { width: 0, height: 0 }; 1645 Wait_Affichage(); 1805 jQuery(window).resize(); 1806 1807 } 1808 1809 // Wait_Affichage(); 1646 1810 }); 1647 1811 1648 1812 jQuery(Parent).live('ON', function (e) { 1649 1813 jQuery(jQuery('.debug').get(1)).trigger('ON'); 1650 1814 Wait_Affichage(); 1651 1815 }); 1652 1816 -
extensions/Autosize/js/JScript.js
r11912 r11961 1 jQuery(document).ready( 2 function (jQuery) { 3 var stt = jQuery('#scrolltobottom'); 4 var stb = jQuery('#scrolltotop'); 1 function getScrollMaxY() { 2 var innerh; 3 if (window.innerHeight) { 4 innerh = window.innerHeight; 5 } else { 6 innerh = document.body.clientHeight; 7 } 8 if (window.innerHeight && window.scrollMaxY) { 9 // Firefox 10 yWithScroll = window.innerHeight + window.scrollMaxY; 11 } else if ( 12 document.body.scrollHeight > document.body.offsetHeight) { 13 // all but Explorer Mac 14 yWithScroll = document.body.scrollHeight; 15 } else { 16 // works in Explorer 6 Strict, Mozilla (not FF) and Safari 17 yWithScroll = document.body.offsetHeight; 18 } 19 return yWithScroll - innerh; 20 } 21 22 jQuery(document).ready(function (jQuery) { 23 jQuery(window).load(function () { 24 if (jQuery("#scrolltotop").length == 0) 25 jQuery('#scrolltobottom').before('<div id="scrolltotop" ><a title="Revenir en haut de la page" href="#"></a></div>'); 26 27 stb = jQuery('#scrolltobottom'); 28 stt = jQuery('#scrolltotop'); 29 stt.css('opacity', 1 ) 30 stb.css('opacity', 1) 31 32 jQuery('#scrolltotop').height(100); 33 jQuery('#scrolltobottom').height(100); 34 jQuery('#scrolltotop').css({ 35 }); 36 jQuery('#scrolltobottom').css({ 37 }); 38 jQuery(window).resize( 39 function (event, ui) { 40 jQuery(window).scroll(); 41 }); 42 43 wmax = jQuery("body").height() - jQuery(window).height(); 44 scrollTop = jQuery(window).scrollTop(); 45 pourcent = (scrollTop / wmax); 46 jQuery(stt).css({ opacity: pourcent }); 47 jQuery(stb).css({ opacity: 1 - pourcent }); 48 49 //=================================================== 50 jQuery(window).scroll(function () { 51 maxi = getScrollMaxY(); 52 wmax = jQuery("body").height() - jQuery(window).height(); 53 scrollTop = jQuery(window).scrollTop(); 54 pourcent = (scrollTop / wmax) ; 5 55 6 56 7 stt.css('opacity', 1);8 var scrollBottom = 0;57 jQuery(stt).css({ opacity:pourcent }); 58 jQuery(stb).css({ opacity: 1-pourcent }); 9 59 10 //===================================================================11 jQuery(window).load(function (event, ui) {12 if (typeof (event) == 'undefined') return;13 scrollBottom = jQuery(window).scrollTop(0);14 var v_max = jQuery("#the_page").height();15 //===================================================================16 jQuery(window).scroll(function () {17 scrollBottom = jQuery(window).scrollTop();18 v_max = jQuery("#the_page").height() - jQuery(window).height();19 if (scrollBottom > 100) {20 if (stt.css('opacity') == 0) {21 stt.stop().fadeTo(1000, 1);22 }23 }24 if (scrollBottom > v_max - 100) {25 if (stb.css('opacity') == 0) {26 stb.stop().fadeTo(1000, 1);27 }28 }29 return;30 60 31 if (scrollBottom < v_max) { 32 if (stb.css('opacity') > 0) { 33 stb.stop().fadeTo(1000, 0); 34 stb.css("display", "none"); 35 } 36 } else { 37 if (stb.css('opacity') == 0) { 38 stb.stop().fadeTo(1000, 1); 39 stb.css("display", "block"); 40 } 41 } 61 jQuery("#scrollmiddle").css("bottom", maxi + "px"); 62 // jQuery("#scrollmiddle").text(pourcent); 63 //==================================================== 64 scrollBottom = jQuery(window).scrollTop(); 42 65 43 //========================================= 44 if (scrollBottom < v_max) { 45 if (stt.css('opacity') == 0) { 46 stt.stop().fadeTo(1000, 1); 47 stt.css("display", "block"); 48 } 49 } else { 50 if (stt.css('opacity') > 0) { 51 stt.stop().fadeTo(1000, 0); 52 stt.css("display", "none"); 66 }); 67 //===================================================== 68 jQuery('#scrolltobottom a').mouseover(function () { 69 wmax = jQuery("body").height() - jQuery(window).height(); 70 scrollTop = jQuery(window).scrollTop(); 71 pourcent = (scrollTop / wmax); 53 72 54 } 55 } 73 stb.stop().fadeTo(500, 1-pourcent); 56 74 57 75 }); 76 jQuery('#scrolltobottom a').mouseout(function () { 77 stb.stop().fadeTo(500, 0); 78 79 }); 80 jQuery('#scrolltotop a').mouseover(function () { 81 wmax = jQuery("body").height() - jQuery(window).height(); 82 scrollTop = jQuery(window).scrollTop(); 83 pourcent = (scrollTop / wmax); 84 stt.stop().fadeTo(500, pourcent); 85 58 86 }); 87 jQuery('#scrolltotop a').mouseout(function () { 88 stt.stop().fadeTo(500, 0); 89 }); 59 90 60 91 jQuery('#scrolltobottom a').click(function () { 61 pos = jQuery('#the_page').outerHeight();92 pos = jQuery("body").height() - jQuery(window).height(); ; 62 93 jQuery('html, body').animate({ 63 94 scrollTop: pos + 'px' 64 95 }, 1000, function () { 65 66 stt.stop().fadeTo(1000, 0);67 stb.stop().fadeTo(1000, 1);68 96 69 97 }); … … 71 99 72 100 jQuery('#scrolltotop a').click(function () { 73 74 101 pos = 0; 75 102 jQuery('html, body').animate({ 76 103 scrollTop: pos + 'px' 77 }, 1000, function () {78 stb.stop().fadeTo(1000, 0); 79 stt.stop().fadeTo(1000, 1); 104 }, 0, function () { 105 106 80 107 }); 81 108 }); 109 //=================================================================== 82 110 83 111 84 function gotoPos(pos) {85 jQuery('html, body').animate({ scrollTop: jQuery('body').outerHeight() + 'px' },86 0, function () {87 scrollBottom = jQuery(window).scrollTop();88 112 89 113 }); 90 91 92 return false;93 }94 //===================================================================95 // jQuery(window).resize();96 jQuery(window).scroll();97 98 99 114 }); 100 115 //========================================================= -
extensions/Autosize/js/autosize.dimensions.js
r11277 r11961 145 145 Css = jQuery(elem).getStyles(elem); 146 146 myposition = Css.position.toString() || ""; 147 148 149 147 width = jQuery(elem).outerWidth(); 150 148 height = jQuery(elem).outerHeight(); 149 elem_parent =elem.parentElement; 150 if (typeof elem_parent == "undefined") { 151 elem_parent = window; 152 } 153 if (typeof Css.width != "undefined") 154 width = jQuery(elem).Get_Val_int(Css.width, jQuery(elem_parent).width(), 0); 155 156 if (typeof Css.height != "undefined") 157 height = jQuery(elem).Get_Val_int(Css.height, jQuery(elem_parent).height(), 0); 158 159 160 161 151 162 152 163 … … 318 329 } 319 330 el = this.get(0); 320 var reg1 = new RegExp("auto", "g") 331 var reg1 = new RegExp("auto", "g"); 321 332 if (myObj.match(reg1)) { 322 333 return Maxi_val; … … 325 336 myObj = num(el, prop); 326 337 else { 327 reg1 = new RegExp("px", "g") 338 reg1 = new RegExp("px", "g"); 328 339 if (myObj.match(reg1)) { 329 340 … … 331 342 332 343 } else { 333 reg1 = new RegExp("%", "g") 344 reg1 = new RegExp("%", "g"); 334 345 if (myObj.match(reg1)) { 346 myObj = myObj.replace(reg1, ""); 335 347 val = Math.ceil(myObj * Maxi_val / 100); 336 348 return val;
Note: See TracChangeset
for help on using the changeset viewer.