Ignore:
Timestamp:
Oct 18, 2010, 3:33:55 PM (14 years ago)
Author:
cljosse
Message:

[Autosize][beta] GMaps compatibility.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/js/Affiche_script.js

    r7220 r7262  
    6060                setTimeout("wait_Timer()", 100);
    6161
    62     }
     62       }
     63
     64     
    6365
    6466 function cl_Timer() {
     
    7173
    7274     currentPosition = 0 - parseInt(jQuery(panoramaContainer).css('margin-left'));
     75     if ( currentPosition == NaN) return;
     76     
     77
    7378     if (currentPosition > 1000)
    7479     jQuery(panoramaContainer).css('margin-left',"0px")
     
    7782 function onPropertyChange(e) {
    7883     var el = e.srcElement;
     84     var new_class=el.className ;
    7985     ID = el.id;
    8086     Prop = e.propertyName.split(".");
    8187     Property = Prop[1];
    82 
    83      Valeur =parseInt( el.currentStyle[Property]);
    84      if (Valeur < -1000) {
    85       //  jQuery( el).css(Property, 500+"px");
    86          return;
     88     if (Property == "display") {
     89         Valeur = parseInt(el.currentStyle[Property]);
     90         if (Valeur=="block"){
     91
     92 
     93         }
    8794     }
    8895     return;
    89  }
     96 }     
     97
    9098/* ready
    9199*
     
    93101*/
    94102 jQuery(document).ready(
     103
    95104
    96105    function (jQuery) {
     
    104113        * recherche la plus grande image (hauteur ou largeur)
    105114        */
     115
     116
     117
     118
    106119        function Get_Img_Maxi(myobj) {
    107120            var w00 = 0;
     
    193206            return val;
    194207        }
     208
     209        /*
     210        *
     211        */
     212
    195213
    196214        /*
     
    729747                jQuery("object").height(Image_height);
    730748            } else if (Type_Img == "panorama") {
    731            
     749
    732750                //      jQuery(TheImg).panorama2(img_finale.height, img_finale.width);
    733751                jQuery(TheImg).height(img_finale.height);
     
    793811                    jQuery(".thumbLink").css("height", init_taille_thumblink.height + "px");
    794812                    jQuery(".thumbLink").css("width", init_taille_thumblink.width + "px");
    795                     //    setTimeout("cl_Timer()", 100);
    796 
     813               
    797814                } else {
    798815
     
    818835
    819836    } // function
    820 );                                                                                                                                                                                                           // ready
     837);                                                                                                                                                                                                                     // ready
    821838
    822839/* Extension
     
    825842 */
    826843//=========================================================
    827 jQuery.fn.extend({
    828     //-------------------------------------------------------
    829     absolutize: function (element) {
    830         element = jQuery(element).get(0);
    831         if (element.getStyle('position') == 'absolute') return;
    832         // Position.prepare(); // To be done manually by Scripty when it needs it.
    833 
    834         var offsets = element.positionedOffset();
    835         var top = offsets[1];
    836         var left = offsets[0];
    837         var width = element.clientWidth;
    838         var height = element.clientHeight;
    839 
    840         element._originalLeft = left - parseFloat(element.style.left || 0);
    841         element._originalTop = top - parseFloat(element.style.top || 0);
    842         element._originalWidth = element.style.width;
    843         element._originalHeight = element.style.height;
    844 
    845         element.style.position = 'absolute';
    846         element.style.top = top + 'px';
    847         element.style.left = left + 'px';
    848         element.style.width = width + 'px';
    849         element.style.height = height + 'px';
    850         return element;
    851     },
    852 
    853     relativize: function (element) {
    854         element = jQuery(element).get(0); ;
    855         if (jQuery(element).css('position') == 'relative') return;
    856         // Position.prepare(); // To be done manually by Scripty when it needs it.
    857         element._originalLeft = parseFloat(element.style.left || 0);
    858         element._originalTop = parseFloat(element.style.top || 0);
    859         element._originalWidth = element.style.width;
    860         element._originalHeight = element.style.height;
    861 
    862         element.style.position = 'relative';
    863         var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
    864         var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
    865 
    866         element.style.top = top + 'px';
    867         element.style.left = left + 'px';
    868         //  element.style.height = element._originalHeight;
    869         // element.style.width  = element._originalWidth;
    870         return element;
    871     }
    872     //=========================================================
    873 });   // fin extend
     844    jQuery.fn.extend({
     845        recentrage_widget: function () {
     846            jQuery('html,body').stop().scrollTop(0);
     847            jQuery('html,body').stop().scrollLeft(0);
     848            jQuery(".ui-widget-overlay").css("opacity", "0.75");
     849
     850            l1 = (jQuery(window).width() - (jQuery(".gmapsPopup").width()))/2;
     851            h1 = (jQuery(window).height() - (jQuery(".gmapsPopup").height()))/2;
     852 
     853            jQuery(".gmapsPopup").css("left", l1 + "px");
     854            jQuery(".gmapsPopup").css("top", h1 + "px");
     855
     856        },
     857        //-------------------------------------------------------
     858        absolutize: function (element) {
     859            element = jQuery(element).get(0);
     860            if (element.getStyle('position') == 'absolute') return;
     861            // Position.prepare(); // To be done manually by Scripty when it needs it.
     862
     863            var offsets = element.positionedOffset();
     864            var top = offsets[1];
     865            var left = offsets[0];
     866            var width = element.clientWidth;
     867            var height = element.clientHeight;
     868
     869            element._originalLeft = left - parseFloat(element.style.left || 0);
     870            element._originalTop = top - parseFloat(element.style.top || 0);
     871            element._originalWidth = element.style.width;
     872            element._originalHeight = element.style.height;
     873
     874            element.style.position = 'absolute';
     875            element.style.top = top + 'px';
     876            element.style.left = left + 'px';
     877            element.style.width = width + 'px';
     878            element.style.height = height + 'px';
     879            return element;
     880        },
     881
     882        relativize: function (element) {
     883            element = jQuery(element).get(0); ;
     884            if (jQuery(element).css('position') == 'relative') return;
     885            // Position.prepare(); // To be done manually by Scripty when it needs it.
     886            element._originalLeft = parseFloat(element.style.left || 0);
     887            element._originalTop = parseFloat(element.style.top || 0);
     888            element._originalWidth = element.style.width;
     889            element._originalHeight = element.style.height;
     890
     891            element.style.position = 'relative';
     892            var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
     893            var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
     894
     895            element.style.top = top + 'px';
     896            element.style.left = left + 'px';
     897            //  element.style.height = element._originalHeight;
     898            // element.style.width  = element._originalWidth;
     899            return element;
     900        }
     901        //=========================================================
     902    });          // fin extend
Note: See TracChangeset for help on using the changeset viewer.