Ignore:
Timestamp:
Jul 27, 2009, 12:01:10 PM (15 years ago)
Author:
grum
Message:

Update AMM 2.1.1 - bug resolved + improvement
See main.inc.php file for details

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMenuManager/menu_templates/menubar_randompic.tpl

    r3681 r3690  
    66{literal}
    77<script type="text/javascript">
    8 //var divnum = 1;
    9 //var divprec = 0;
     8var fixedHeight = {/literal}{$block->data.blockHeight}{literal};
    109
    1110  function init()
    1211  {
    13     $("#iamm_ill0").hide();
    14     //$("#iamm_ill1").hide();
     12    {/literal}
     13    {if $block->data.blockHeight>0}
     14      $("#irandompicinner").height(fixedHeight);
     15      {literal}$("#iammrpic").load( function () { computePositionTop(); } );{/literal}
     16    {else}
     17      {literal}
     18      $("#iammrpic").load( function () { $("#irandompicinner").animate({height: ($("#iamm_ill0").innerHeight())+"px"}, "normal"); } );
     19      {/literal}
     20    {/if}
     21    {literal}
     22  }
     23
     24  function computePositionTop()
     25  {
     26    $("#iamm_ill0").css({top:(fixedHeight-$("#iamm_ill0").innerHeight())/2});
    1527  }
    1628
    1729  function getRandomPicture()
    1830  {
    19     //divprec=divnum;
    20     //divnum=1-divnum;
    2131    $.get("./index.php", {ajaxfct:"randompic"},
    2232      function (data)
     
    2535        {
    2636          $("#iamm_ill0").html(data);
    27           $("#iammrpic").load( function () {
    28             $("#irandompicdd").animate({height: ($("#iamm_ill0").height())+"px"}, "normal", function ()
    29             {
    30               $("#iamm_ill0").fadeTo('slow', 1, function ()
     37
     38          {/literal}
     39          {if $block->data.blockHeight>0}
     40            {literal}
     41            $("#iammrpic").load( function () {
     42              computePositionTop();
     43              $("#iamm_ill0").fadeTo('slow', 1);
     44            } );
     45            {/literal}
     46          {else}
     47            {literal}
     48            $("#iammrpic").load( function () {
     49              $("#irandompicinner").animate({height: ($("#iamm_ill0").innerHeight())+"px"}, "normal", function ()
    3150              {
    32                 $("#irandompicdd").animate({height: this.clientHeight+"px"}, "normal");
     51                $("#iamm_ill0").fadeTo('slow', 1, function ()
     52                {
     53                  $("#irandompicinner").animate({height: this.clientHeight+"px"}, "normal");
     54                });
    3355              });
    34             });
    35           } );
     56            } );
     57            {/literal}
     58          {/if}
     59          {literal}
     60
    3661        } );
    3762      }
    3863    );
    3964  }
     65
     66
    4067</script>
    4168{/literal}
    4269
    4370<dd id="irandompicdd" class="randompicdd">
    44   <div id="iamm_ill0" class="illustration ammillustration"></div>
    45   <!--<div id="iamm_ill1" class="illustration ammillustration"></div>-->
     71  <div id="irandompicinner" class="illustration">
     72    <div class="ammillustrationc">
     73      <div id="iamm_ill0" class="ammillustration">{$block->data.firstPicture}</div>
     74    </div>
     75  </div>
    4676</dd>
    4777
    4878<script type="text/javascript">
    49   getRandomPicture();
     79  init();
    5080  {if $block->data.delay > 0 }
    5181    var vIntervalID = window.setInterval(getRandomPicture, {$block->data.delay});
Note: See TracChangeset for help on using the changeset viewer.