Changeset 17349 for extensions


Ignore:
Timestamp:
Aug 3, 2012, 5:48:51 PM (12 years ago)
Author:
mistic100
Message:

improving slider display when mixing landscape and portrait photos (must use elastic=true if mixing panoramas)

Location:
extensions/ExtendedDescription
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/ExtendedDescription/main.inc.php

    r17181 r17349  
    616616 
    617617  // sort pictures
    618   function rank_sort($a, $b)
    619   {
    620     global $ids;
    621     return array_search($a, $ids) > array_search($b, $ids);
    622   }
    623   uksort($pictures, 'rank_sort');
     618  if (!function_exists('ed_rank_sort'))
     619  {
     620    function ed_rank_sort($a, $b)
     621    {
     622      global $ids;
     623      return array_search($a, $ids) > array_search($b, $ids);
     624    }
     625  }
     626  uksort($pictures, 'ed_rank_sort');
    624627 
    625628  foreach ($pictures as $row)
  • extensions/ExtendedDescription/template/nivoslider/jquery.nivo.slider.js

    r17010 r17349  
    1111 * July 25th 2012
    1212 * Damien (Mistic) Sorel
    13  * ability to stop slideshow with beforeChange (line 318)
     13 * ability to stop slideshow with beforeChange (line 343)
     14 */
     15 
     16/**
     17 * August 3rd 2012
     18 * Damien (Mistic) Sorel (from http://joshfester.com/differing-image-heights-in-nivo-slider)
     19 * dynamic width (lines 95 & 102 & 322-338)
    1420 */
    1521
     
    8793        // Detect Window Resize
    8894        $(window).resize(function() {
    89             slider.children('img').width(slider.width());
     95            //slider.children('img').width(slider.width());
    9096            sliderImg.attr('src', vars.currentImage.attr('src'));
    9197            sliderImg.stop().height('auto');
     
    9399            $('.nivo-box').remove();
    94100        });
     101       
     102        slider.width($(kids[vars.currentSlide]).width());
    95103
    96104        //Create caption
     
    312320            }
    313321           
     322            // resize the slider (don't resize for diff < 20px)
     323            if (vars.currentSlide+1 == vars.totalSlides) {
     324                next_width = $(kids[0]).width();
     325            }
     326            else {
     327                next_width = $(kids[vars.currentSlide + 1]).width();
     328            }
     329            if (Math.abs(next_width - slider.width()) > 20) {
     330                slider.animate({width: next_width}, 'fast', function() { nivoRun2(slider, kids, settings, nudge) });
     331            }
     332            else {
     333                nivoRun2(slider, kids, settings, nudge);
     334            }
     335           
     336        };
     337       
     338        var nivoRun2 = function(slider, kids, settings, nudge){       
    314339            // Stop
    315340            if((!vars || vars.stop) && !nudge) { return false; }
  • extensions/ExtendedDescription/template/nivoslider/nivo-slider.css

    r17010 r17349  
    99 
    1010/* The Nivo Slider styles */
     11.slider-wrapper {
     12        margin:0 auto;
     13}
    1114.nivoSlider {
    1215        position:relative;
     
    1417        height:auto;
    1518        overflow: hidden;
     19        margin: 0 auto;
    1620}
    1721.nivoSlider img {
     
    2327        display: block !important;
    2428        position: relative !important;
    25         width: 100% !important;
     29        //width: 100% !important;
     30        margin: 0 auto;
    2631}
    2732
  • extensions/ExtendedDescription/template/slider.tpl

    r17010 r17349  
    2525
    2626{if not $elastic_size}
    27 {* assign var=slider_min_w value=$img_size.w *}
    2827{assign var=slider_min_h value=$img_size.h}
    2928{/if}
    3029
    31 <div class="slider-wrapper theme-default" style="width:{$img_size.w}px;{if $elastic_size}height:{math equation='x+y' x=$img_size.h y=40}px;{/if}margin:0 auto;">
     30<div class="slider-wrapper theme-default" style="width:{$img_size.w}px;{if $elastic_size}height:{math equation='x+y' x=$img_size.h y=40}px;{/if}">
    3231  <div id="slider{$slider_id}" class="nivoSlider" style="width:{$img_size.w}px;{if $elastic_size}height:{$img_size.h}px;{/if}">
    3332  {foreach from=$slider_content item=thumbnail}{strip}
     
    3837    {/if}
    3938   
    40     <img {if $derivative->is_cached()}src="{$derivative->get_url()}"{else}src="" data-src="{$derivative->get_url()}"{/if} alt="{$thumbnail.TN_ALT}" {if $show_title}title="<a href='{$thumbnail.URL}'>{$thumbnail.NAME|replace:'"':"'"}</a>"{/if}>
     39    <img {if $derivative->is_cached()}src="{$derivative->get_url()}"{else}src="" data-src="{$derivative->get_url()}"{/if} alt="{$thumbnail.TN_ALT}" {$derivative->get_size_htm()} {if $show_title}title="<a href='{$thumbnail.URL}'>{$thumbnail.NAME|replace:'"':"'"}</a>"{/if}>
    4140   
    4241    {if not $elastic_size}
    4342    {assign var=derivative_size value=$derivative->get_size()}
    44     {* math assign=slider_min_w equation="min(x,y)" x=$slider_min_w y=$derivative_size[0] *}
    4543    {math assign=slider_min_h equation="min(x,y)" x=$slider_min_h y=$derivative_size[1]}
    4644    {/if}
     
    5250{footer_script}
    5351$("#slider{$slider_id}").css({ldelim}
    54   {* width: {$slider_min_w}, *}
    5552  height: {$slider_min_h}
    5653});
Note: See TracChangeset for help on using the changeset viewer.