Ignore:
Timestamp:
Nov 24, 2009, 11:22:08 PM (14 years ago)
Author:
grum
Message:

[AMM] moving the JS for the "random image" outside the <DL> tag

Location:
extensions/AMenuManager/menu_templates
Files:
1 added
1 edited

Legend:

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

    r3690 r4363  
    44<dt>{$block->get_title()}</dt>
    55
    6 {literal}
    7 <script type="text/javascript">
    8 var fixedHeight = {/literal}{$block->data.blockHeight}{literal};
    9 
    10   function init()
    11   {
    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});
    27   }
    28 
    29   function getRandomPicture()
    30   {
    31     $.get("./index.php", {ajaxfct:"randompic"},
    32       function (data)
    33       {
    34         $("#iamm_ill0").fadeTo('slow', 0, function ()
    35         {
    36           $("#iamm_ill0").html(data);
    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 ()
    50               {
    51                 $("#iamm_ill0").fadeTo('slow', 1, function ()
    52                 {
    53                   $("#irandompicinner").animate({height: this.clientHeight+"px"}, "normal");
    54                 });
    55               });
    56             } );
    57             {/literal}
    58           {/if}
    59           {literal}
    60 
    61         } );
    62       }
    63     );
    64   }
    65 
    66 
    67 </script>
    68 {/literal}
    696
    707<dd id="irandompicdd" class="randompicdd">
     
    7613</dd>
    7714
    78 <script type="text/javascript">
    79   init();
    80   {if $block->data.delay > 0 }
    81     var vIntervalID = window.setInterval(getRandomPicture, {$block->data.delay});
    82   {/if}
    83 </script>
Note: See TracChangeset for help on using the changeset viewer.