Changeset 1763200
- Timestamp:
- 11/10/2017 06:05:25 PM (8 years ago)
- Location:
- gallery-slideshow
- Files:
-
- 2 edited
-
tags/1.4.1/gss.js (modified) (4 diffs)
-
trunk/gss.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gallery-slideshow/tags/1.4.1/gss.js
r1761042 r1763200 6 6 jQuery(this).hide(); 7 7 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('►');22 8 }); 23 9 }; … … 36 22 }); 37 23 38 jQuery(document).on('cycle-post-initialize', '.cycle-slideshow', function(){ 24 jQuery(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 }); 39 43 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(){ 44 48 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){ 51 50 jQuery(this).css('width', '100%'); 52 }53 else if(imgw == ssw){54 jQuery(this).css('margin-left', '');55 51 } 56 52 }); … … 65 61 jQuery(this).parent().children('.gss-info').children('.carousel-pager').cycle('goto', indx); 66 62 } 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');70 63 }); 71 64 }); … … 110 103 jQuery(document).ready(function(jQuery){ 111 104 gss_info_height(); 112 play_button();113 105 }); -
gallery-slideshow/trunk/gss.js
r1761042 r1763200 6 6 jQuery(this).hide(); 7 7 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('►');22 8 }); 23 9 }; … … 36 22 }); 37 23 38 jQuery(document).on('cycle-post-initialize', '.cycle-slideshow', function(){ 24 jQuery(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 }); 39 43 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(){ 44 48 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){ 51 50 jQuery(this).css('width', '100%'); 52 }53 else if(imgw == ssw){54 jQuery(this).css('margin-left', '');55 51 } 56 52 }); … … 65 61 jQuery(this).parent().children('.gss-info').children('.carousel-pager').cycle('goto', indx); 66 62 } 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');70 63 }); 71 64 }); … … 110 103 jQuery(document).ready(function(jQuery){ 111 104 gss_info_height(); 112 play_button();113 105 });
Note: See TracChangeset
for help on using the changeset viewer.