Plugin Directory

Changeset 1763200


Ignore:
Timestamp:
11/10/2017 06:05:25 PM (8 years ago)
Author:
jethin
Message:

gss.js update

Location:
gallery-slideshow
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gallery-slideshow/tags/1.4.1/gss.js

    r1761042 r1763200  
    66        jQuery(this).hide();
    77        jQuery(this).next('.gss-captions').css('min-height', long_cap_height);
    8     });
    9 };
    10 
    11 function play_button(){
    12     jQuery('.gss-play').toggle(function() {
    13         jQuery(this).closest('.gss-container').children('.cycle-slideshow').cycle('resume');
    14     }, function() {
    15         jQuery(this).closest('.gss-container').children('.cycle-slideshow').cycle('pause');
    16     });
    17     jQuery('.cycle-slideshow').on('cycle-resumed', function(){
    18         jQuery(this).next('.gss-info').find('.gss-play').text('||');
    19     });
    20     jQuery('.cycle-slideshow').on('cycle-paused', function(){
    21         jQuery(this).next('.gss-info').find('.gss-play').html('►');
    228    });
    239};
     
    3622});
    3723
    38 jQuery(document).on('cycle-post-initialize', '.cycle-slideshow', function(){
     24jQuery(document).on('cycle-post-initialize', '.cycle-slideshow', function(e, opts){
     25    var ss = jQuery(this).closest('.gss-container').children('.cycle-slideshow');
     26    var play_button = ss.next('.gss-info').find('.gss-play');
     27    jQuery('.gss-next, .gss-prev, .gss-pager > a, .carousel-pager .cycle-slide').click(function() {
     28        ss.cycle('pause');
     29    });
     30    if(opts.paused == false){
     31        play_button.text('||');
     32    }
     33    play_button.click(function(){
     34        if(opts.paused == true){ ss.cycle('resume'); }
     35        else{ ss.cycle('pause'); }
     36    });
     37    ss.on('cycle-resumed', function(){
     38        play_button.text('||');
     39    });
     40    ss.on('cycle-paused', function(){
     41        play_button.html('►');
     42    });
    3943    if (!jQuery(this).hasClass('carousel-pager')){
    40         // var centering = jQuery(this).data('cycle-center-horz'); 
    41         var ssw = jQuery(this).width();
    42         jQuery('a.cycle-slide', this).each(function() {
    43             jQuery(this).load(function() {
     44        var ssw = jQuery(this).width();
     45        var img_expand = Math.floor(ssw*0.93);
     46        jQuery('a.cycle-slide img', this).each(function(){
     47            jQuery(this).load(function(){
    4448                imgw = jQuery(this).width();
    45                 /* if(centering == true && imgw < (ssw*0.9)){
    46                     margin = Math.round((ssw - imgw)/2);
    47                     jQuery(this).css('margin-left', margin);
    48                 } */
    49                 if(imgw != ssw && imgw > (ssw*0.9)){
    50                     jQuery(this).css('margin-left', '');
     49                if(imgw != ssw && imgw > img_expand){
    5150                    jQuery(this).css('width', '100%');
    52                 }
    53                 else if(imgw == ssw){
    54                     jQuery(this).css('margin-left', '');
    5551                }
    5652            });
     
    6561            jQuery(this).parent().children('.gss-info').children('.carousel-pager').cycle('goto', indx);
    6662        }
    67     });
    68     jQuery('.gss-next, .gss-prev, .gss-pager > a, .carousel-pager .cycle-slide').click(function() {
    69         jQuery(this).closest('.gss-container').children('.cycle-slideshow').cycle('pause');
    7063    });
    7164});
     
    110103jQuery(document).ready(function(jQuery){
    111104    gss_info_height();
    112     play_button();
    113105});
  • gallery-slideshow/trunk/gss.js

    r1761042 r1763200  
    66        jQuery(this).hide();
    77        jQuery(this).next('.gss-captions').css('min-height', long_cap_height);
    8     });
    9 };
    10 
    11 function play_button(){
    12     jQuery('.gss-play').toggle(function() {
    13         jQuery(this).closest('.gss-container').children('.cycle-slideshow').cycle('resume');
    14     }, function() {
    15         jQuery(this).closest('.gss-container').children('.cycle-slideshow').cycle('pause');
    16     });
    17     jQuery('.cycle-slideshow').on('cycle-resumed', function(){
    18         jQuery(this).next('.gss-info').find('.gss-play').text('||');
    19     });
    20     jQuery('.cycle-slideshow').on('cycle-paused', function(){
    21         jQuery(this).next('.gss-info').find('.gss-play').html('&#9658;');
    228    });
    239};
     
    3622});
    3723
    38 jQuery(document).on('cycle-post-initialize', '.cycle-slideshow', function(){
     24jQuery(document).on('cycle-post-initialize', '.cycle-slideshow', function(e, opts){
     25    var ss = jQuery(this).closest('.gss-container').children('.cycle-slideshow');
     26    var play_button = ss.next('.gss-info').find('.gss-play');
     27    jQuery('.gss-next, .gss-prev, .gss-pager > a, .carousel-pager .cycle-slide').click(function() {
     28        ss.cycle('pause');
     29    });
     30    if(opts.paused == false){
     31        play_button.text('||');
     32    }
     33    play_button.click(function(){
     34        if(opts.paused == true){ ss.cycle('resume'); }
     35        else{ ss.cycle('pause'); }
     36    });
     37    ss.on('cycle-resumed', function(){
     38        play_button.text('||');
     39    });
     40    ss.on('cycle-paused', function(){
     41        play_button.html('&#9658;');
     42    });
    3943    if (!jQuery(this).hasClass('carousel-pager')){
    40         // var centering = jQuery(this).data('cycle-center-horz'); 
    41         var ssw = jQuery(this).width();
    42         jQuery('a.cycle-slide', this).each(function() {
    43             jQuery(this).load(function() {
     44        var ssw = jQuery(this).width();
     45        var img_expand = Math.floor(ssw*0.93);
     46        jQuery('a.cycle-slide img', this).each(function(){
     47            jQuery(this).load(function(){
    4448                imgw = jQuery(this).width();
    45                 /* if(centering == true && imgw < (ssw*0.9)){
    46                     margin = Math.round((ssw - imgw)/2);
    47                     jQuery(this).css('margin-left', margin);
    48                 } */
    49                 if(imgw != ssw && imgw > (ssw*0.9)){
    50                     jQuery(this).css('margin-left', '');
     49                if(imgw != ssw && imgw > img_expand){
    5150                    jQuery(this).css('width', '100%');
    52                 }
    53                 else if(imgw == ssw){
    54                     jQuery(this).css('margin-left', '');
    5551                }
    5652            });
     
    6561            jQuery(this).parent().children('.gss-info').children('.carousel-pager').cycle('goto', indx);
    6662        }
    67     });
    68     jQuery('.gss-next, .gss-prev, .gss-pager > a, .carousel-pager .cycle-slide').click(function() {
    69         jQuery(this).closest('.gss-container').children('.cycle-slideshow').cycle('pause');
    7063    });
    7164});
     
    110103jQuery(document).ready(function(jQuery){
    111104    gss_info_height();
    112     play_button();
    113105});
Note: See TracChangeset for help on using the changeset viewer.