Changeset 1738488
- Timestamp:
- 09/29/2017 03:10:43 PM (9 years ago)
- Location:
- ga-image-carousel/trunk
- Files:
-
- 5 edited
-
ga-image-carousel-basic.css (modified) (2 diffs)
-
ga-image-carousel-dark.css (modified) (2 diffs)
-
ga-image-carousel.js (modified) (9 diffs)
-
ga-image-carousel.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ga-image-carousel/trunk/ga-image-carousel-basic.css
r1737747 r1738488 16 16 padding:10px; 17 17 width: 100%; 18 cursor:pointer; 18 19 } 19 20 .basic .ga-roll { … … 59 60 font-size:14px; 60 61 overflow:hidden; 61 width:90%;62 margin-left:5%;63 62 z-index:2; 64 63 } -
ga-image-carousel/trunk/ga-image-carousel-dark.css
r1737747 r1738488 16 16 padding:10px; 17 17 width: 100%; 18 } 18 cursor:pointer; 19 } 19 20 .dark .ga-roll { 20 21 position: relative; … … 59 60 font-size:14px; 60 61 overflow:hidden; 61 width:90%;62 margin-left:5%;63 62 z-index:2; 64 63 } -
ga-image-carousel/trunk/ga-image-carousel.js
r1738275 r1738488 28 28 this.proportionY; 29 29 this.easing = "linear"; 30 this.border; 31 this.borderR; 32 this.borderC; 33 this.margin; 34 this.nav; 30 35 this.customStyle; 31 36 var self = this; … … 46 51 this.an = this.carousel.data("animation"); 47 52 this.cp = this.carousel.data("caption"); 53 this.b = this.carousel.data("border"); 54 this.bc = this.carousel.data("border-color"); 55 this.br = this.carousel.data("border-radius"); 56 this.mr = this.carousel.data("margin"); 57 this.nv = this.carousel.data("navigation"); 58 59 if(typeof this.b != "undefined"){this.border = this.b;} 60 if(typeof this.bc != "undefined"){this.borderC = this.bc;} 61 if(typeof this.br != "undefined"){this.borderR = this.br;} 62 if(typeof this.mr != "undefined"){this.margin = this.mr;} 63 if(typeof this.nv != "undefined"){this.nav = this.nv;} 48 64 49 65 if(typeof this.dl == "undefined"){this.autoplaydelay = 5000;}else{this.autoplaydelay = this.dl*1000;} … … 61 77 62 78 createCustomCSS.call(this); 63 79 64 80 this.carouselWidth = this.carousel.width(); 65 81 this.projectWidth = this.project.outerWidth() + parseInt(this.project.css('margin-right').replace('px','')); … … 97 113 } 98 114 99 }115 } 100 116 101 117 function createCustomCSS() { … … 105 121 var imgW; 106 122 var addheight = 0; 123 var addProject =''; 124 var addP =''; 107 125 108 126 this.captionH=$(this.id+' .ga-project p').outerHeight(true); 109 127 128 if (typeof this.border != "undefined"){ 129 130 addProject +="border-width:"+this.border+"px;"; 131 132 if (typeof this.borderC != "undefined"){ 133 134 addProject +="border-color:"+this.borderC+";"; 135 addP +="background:"+this.borderC+";"; 136 } 137 138 if (typeof this.borderR != "undefined"){ 139 140 if (this.borderR != 0){ 141 142 if(!this.borderR.indexOf('%')) 143 {this.borderR = this.borderR+"px";} 144 145 } 146 147 addProject +="border-radius:"+this.borderR+";-webkit-border-radius:"+this.borderR+";-moz-border-radius:"+this.borderR+";"; 148 149 } 150 151 } 152 153 if (typeof this.margin != "undefined"){ 154 155 addProject +="margin-right:"+this.margin+"px;"; 156 157 } 158 159 if (this.nav == 0){ 160 161 $(this.id).find('.ga-navigation').hide(); 162 163 } 164 110 165 if (this.proportionX == "auto"){ 111 166 112 proportion = this.imgWidth/this.imgHeight;113 167 proportion = this.imgWidth/this.imgHeight; 168 114 169 }else{ 115 170 116 proportion = this.proportionX/this.proportionY;117 118 }119 171 proportion = this.proportionX/this.proportionY; 172 173 } 174 120 175 if (this.captionH != null){ 121 176 122 177 addheight = this.captionH; 123 }124 178 } 179 125 180 this.customStyle = "<style>"; 126 181 127 182 if (proportion == 1){ 128 183 129 this.customStyle += this.id+" .ga-project div{width:"+this.configProjectWidth+"px;height:"+this.configProjectWidth+"px}";130 this.customStyle += this.id+" .ga-project {width:"+this.configProjectWidth+"px;height:"+(Number(this.configProjectWidth)+Number(addheight))+"px}";184 this.customStyle += this.id+" .ga-project div{width:"+this.configProjectWidth+"px;height:"+this.configProjectWidth+"px}"; 185 this.customStyle += this.id+" .ga-project {width:"+this.configProjectWidth+"px;height:"+(Number(this.configProjectWidth)+Number(addheight))+"px;"+addProject+"}"; 131 186 imgH = this.configProjectWidth+"px"; 132 187 imgW = "auto"; … … 135 190 136 191 if (proportion > 1){ 137 192 138 193 imgH = Number(this.configProjectWidth/proportion)+Number(addheight)+"px"; 139 194 imgW = this.configProjectWidth+"px"; 140 195 141 196 this.customStyle += this.id+" .ga-project div{width:"+this.configProjectWidth+"px;height:"+imgH+";}"; 142 this.customStyle += this.id+" .ga-project{width:"+this.configProjectWidth+"px;height:"+imgH+"; }";197 this.customStyle += this.id+" .ga-project{width:"+this.configProjectWidth+"px;height:"+imgH+";"+addProject+"}"; 143 198 this.customStyle += this.id+" .ga-project img {min-height:100%;width:"+imgW+";}"; 144 199 }else{ … … 147 202 imgW = "auto"; 148 203 this.customStyle += this.id+" .ga-project div{width:"+this.configProjectWidth+"px;height:"+imgH+";}"; 149 this.customStyle += this.id+" .ga-project {width:"+this.configProjectWidth+"px;height:"+imgH+"; }";204 this.customStyle += this.id+" .ga-project {width:"+this.configProjectWidth+"px;height:"+imgH+";"+addProject+"}"; 150 205 this.customStyle += this.id+" .ga-project img {height:"+imgH+";width:"+imgW+";}"; 151 206 } 152 207 153 } 154 155 156 208 } 209 this.customStyle += this.id+" .ga-project p{"+addP+"}"; 157 210 this.customStyle +="</style>"; 158 211 $('head').append(this.customStyle); … … 168 221 169 222 if(typeof $.fancybox != 'function') { 170 171 $links.on('click touchstart', function() {172 $.fancybox.open( $links, {173 }, $links.index( this ) );174 175 return false;176 });177 178 } 179 180 this.carousel.on('mousedown touchstart', 'div',function(event){223 224 $links.on('click touchstart', function() { 225 $.fancybox.open( $links, { 226 }, $links.index( this ) ); 227 228 return false; 229 }); 230 231 } 232 233 this.carousel.on('mousedown touchstart', function(event){ 181 234 event.preventDefault(); 182 235 event.stopPropagation(); 183 236 clearInterval(self.autoplayTimer); 184 237 drag = true; 185 238 186 239 }); 187 240 … … 218 271 219 272 } 220 }); 273 }); 221 274 222 275 } -
ga-image-carousel/trunk/ga-image-carousel.php
r1738231 r1738488 4 4 Plugin URI: http://www.graphicarea.pro/en/ga-image-carousel-v1-en 5 5 Description: Simple and light image carousel with animation and fancybox. 6 Version: 1.0. 16 Version: 1.0.2 7 7 Author: Anatoly Ludischev 8 8 Author URI: http://www.graphicarea.pro … … 20 20 21 21 add_action( 'wp_enqueue_scripts', 'ga_wp_add_basic_scripts' ); 22 add_image_size( 'ga-image-size', 500, 500, array( 'center', 'center' )); 22 23 23 24 … … 37 38 'clickable' => '1', 38 39 'caption' => '1', 40 'border' => '10', 41 'border-color' => '#ffffff', 42 'border-radius' => '0', 43 'margin' => '10', 44 'navigation' => '1', 39 45 ); 40 46 41 47 $user_config = ""; 42 48 $image_caption = ""; 49 $proportion = 0; 43 50 44 51 if(isset ($args['theme'])){$config['theme'] = $args['theme'];} … … 53 60 } 54 61 } 62 } 63 $ga_size = array($config['width-item'], $config['width-item']); 64 if ($config['proportion'] != 'auto') { 65 $proportion = explode(":", $config['proportion']); 66 $proportion = $proportion[0] / $proportion[1]; 67 } 68 if ($proportion == 1) { 69 $ga_size = 'ga-image-size' ; 55 70 } 56 71 $ids = explode(',', $args['ids']); … … 77 92 78 93 79 $html.= wp_get_attachment_image( $id, array($config['width-item'], $config['width-item'])).'</a></div>'.$image_caption.'</div>';94 $html.= wp_get_attachment_image( $id, $ga_size).'</a></div>'.$image_caption.'</div>'; 80 95 } else { 81 $html.= '<div class="ga-project"><div>'.wp_get_attachment_image( $id, array($config['width-item'], $config['width-item'])).'</div>'.$image_caption.'</div>';96 $html.= '<div class="ga-project"><div>'.wp_get_attachment_image( $id, $ga_size).'</div>'.$image_caption.'</div>'; 82 97 } 83 98 -
ga-image-carousel/trunk/readme.txt
r1738298 r1738488 51 51 52 52 ` 53 ids => use image ids 54 direction => left / right. default: right 55 duration => from 0 to ∞ (in sec). default: 0.4 56 animation => bysection / linear. default: bysection 57 delay => from 0 to ∞ (in sec). default: 5 58 width => px / %. default: 100% 59 width-item => px / %. default: 150px 60 proportion => example: 1:3.5 / auto . default: 1:1 61 clickable => 0 / 1. default: 1 62 fancy => 0 / 1. default: 1 63 theme => basic / dark. default: basic 64 caption => 0 / 1. default: 1 53 ids => use image ids 54 direction => left / right. default: right 55 duration => from 0 to ∞ (in sec). default: 0.4 56 animation => bysection / linear. default: bysection 57 delay => from 0 to ∞ (in sec). default: 5 58 width => px / %. default: 100% 59 width-item => px / %. default: 150px 60 proportion => example: 1:3.5 / auto . default: 1:1 61 clickable => 0 / 1. default: 1 62 fancy => 0 / 1. default: 1 63 theme => basic / dark. default: basic 64 caption => 0 / 1. default: 1 65 border => from 0 to ∞. default: 10 66 border-color => in rgb, rgba or hex. default: #ffffff 67 border-radius => in px, % or 0 (disable). default: 0 68 margin => from 0 to ∞. default: 10 69 navigation => 0 or 1. default: 1 65 70 ` 66 71 … … 81 86 == Changelog == 82 87 88 = 1.0.2 = 89 * Add Customization Features 83 90 84 91 = 1.0.1 =
Note: See TracChangeset
for help on using the changeset viewer.