1/* 2 3 Supersized - Fullscreen Slideshow jQuery Plugin 4 Version : 3.2.0 5 Theme : Shutter 6 7 Site : www.buildinternet.com/project/supersized 8 Author : Sam Dunn 9 Company : One Mighty Roar (www.onemightyroar.com) 10 License : MIT License / GPL License 11 12*/ 13 14(function($){ 15 16 theme = { 17 18 19 /* Initial Placement 20 ----------------------------*/ 21 _init : function(){ 22 23 // Center Slide Links 24 if (api.options.slide_links) $(vars.slide_list).css('margin-left', -$(vars.slide_list).width()/2); 25 26 // Start progressbar if autoplay enabled 27 if (api.options.autoplay){ 28 if (api.options.progress_bar) theme.progressBar(); 29 }else{ 30 if ($(vars.play_button).attr('src')) $(vars.play_button).attr("src", api.options.image_path + "play.png"); // If pause play button is image, swap src 31 if (api.options.progress_bar) $(vars.progress_bar).stop().animate({left : -$(window).width()}, 0 ); // Place progress bar 32 } 33 34 35 /* Thumbnail Tray 36 ----------------------------*/ 37 // Hide tray off screen 38 //$(vars.thumb_tray).animate({bottom : -$(vars.thumb_tray).height()}, 0 ); 39 // Thumbnail Tray Toggle 40 $(vars.tray_button).toggle(function(){ 41 $(vars.thumb_tray).stop().animate({bottom : -$(vars.thumb_tray).height(), avoidTransforms : true}, 300 ); 42 if ($(vars.tray_arrow).attr('src')) $(vars.tray_arrow).attr("src", api.options.image_path + "button-tray-up.png"); 43 return false; 44 }, function() { 45 $(vars.thumb_tray).stop().animate({bottom : 56, avoidTransforms : true}, 300 ); 46 if ($(vars.tray_arrow).attr('src')) $(vars.tray_arrow).attr("src", api.options.image_path + "button-tray-down.png"); 47 return false; 48 }); 49 50 // Make thumb tray proper size 51 $(vars.thumb_list).width($('> li', vars.thumb_list).length * $('> li', vars.thumb_list).outerWidth(true)); //Adjust to true width of thumb markers 52 $('#slidecaption').fadeIn('slow'); 53 // Display total slides 54 if ($(vars.slide_total).length){ 55 $(vars.slide_total).html(api.options.slides.length); 56 } 57 58 /* Custom addition 59 jQuery("#thumb-list li img").hover( 60 function () { 61 jQuery(this).stop().animate({opacity:'1'},600); 62 }, 63 function () { 64 jQuery(this).stop().animate({opacity:'1'},300); 65 }); 66 */ 67 /* Thumbnail Tray Navigation 68 ----------------------------*/ 69 if (api.options.thumb_links){ 70 //Hide thumb arrows if not needed 71 if ($(vars.thumb_list).width() <= $(vars.thumb_tray).width()){ 72 $(vars.thumb_back +','+vars.thumb_forward).fadeOut(0); 73 } 74 75 // Thumb Intervals 76 vars.thumb_interval = Math.floor($(vars.thumb_tray).width() / $('> li', vars.thumb_list).outerWidth(true)) * $('> li', vars.thumb_list).outerWidth(true); 77 vars.thumb_page = 0; 78 79 // Cycle thumbs forward 80 $(vars.thumb_forward).click(function(){ 81 if (vars.thumb_page - vars.thumb_interval <= -$(vars.thumb_list).width()){ 82 vars.thumb_page = 0; 83 $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); 84 }else{ 85 vars.thumb_page = vars.thumb_page - vars.thumb_interval; 86 $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); 87 } 88 }); 89 90 // Cycle thumbs backwards 91 $(vars.thumb_back).click(function(){ 92 if (vars.thumb_page + vars.thumb_interval > 0){ 93 vars.thumb_page = Math.floor($(vars.thumb_list).width() / vars.thumb_interval) * -vars.thumb_interval; 94 if ($(vars.thumb_list).width() <= -vars.thumb_page) vars.thumb_page = vars.thumb_page + vars.thumb_interval; 95 $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); 96 }else{ 97 vars.thumb_page = vars.thumb_page + vars.thumb_interval; 98 $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); 99 } 100 }); 101 102 } 103 104 105 /* Navigation Items 106 ----------------------------*/ 107 $(vars.next_slide).click(function() { 108 api.nextSlide(); 109 }); 110 111 $(vars.prev_slide).click(function() { 112 api.prevSlide(); 113 }); 114 115 $("#tray-panelnext").click(function() { 116 api.nextSlide(); 117 }); 118 119 $("#tray-panelprev").click(function() { 120 api.prevSlide(); 121 }); 122 123 // Full Opacity on Hover 124 if(jQuery.support.opacity){
125 $(vars.prev_slide +','+vars.next_slide).mouseover(function() { 126 $(this).stop().animate({opacity:1},100); 127 }).mouseout(function(){ 128 $(this).stop().animate({opacity:0.8},100); 129 }); 130 } 131 132 if (api.options.thumbnail_navigation){ 133 // Next thumbnail clicked 134 $(vars.next_thumb).click(function() { 135 api.nextSlide(); 136 }); 137 // Previous thumbnail clicked 138 $(vars.prev_thumb).click(function() { 139 api.prevSlide(); 140 }); 141 } 142 143 $(vars.play_button).click(function() { 144 api.playToggle(); 145 }); 146 147 148 /* Thumbnail Mouse Scrub 149 ----------------------------*/ 150 if (api.options.mouse_scrub){ 151 $(vars.thumb_tray).mousemove(function(e) { 152 var containerWidth = $(vars.thumb_tray).width(), 153 listWidth = $(vars.thumb_list).width(); 154 if (listWidth > containerWidth){ 155 var mousePos = 1, 156 diff = e.pageX - mousePos; 157 if (diff > 10 || diff < -10) { 158 mousePos = e.pageX; 159 newX = (containerWidth - listWidth) * (e.pageX/containerWidth); 160 diff = parseInt(Math.abs(parseInt($(vars.thumb_list).css('left'))-newX )).toFixed(0); 161 $(vars.thumb_list).stop().animate({'left':newX}, {duration:diff*3, easing:'easeOutExpo'}); 162 } 163 } 164 }); 165 } 166 167 168 /* Window Resize 169 ----------------------------*/ 170 $(window).resize(function(){ 171 172 // Delay progress bar on resize 173 if (api.options.progress_bar && !vars.in_animation){ 174 if (vars.slideshow_interval) clearInterval(vars.slideshow_interval); 175 if (api.options.slides.length - 1 > 0) clearInterval(vars.slideshow_interval); 176 177 $(vars.progress_bar).stop().animate({left : -$(window).width()}, 0 ); 178 179 if (!vars.progressDelay && api.options.slideshow){ 180 // Delay slideshow from resuming so Chrome can refocus images 181 vars.progressDelay = setTimeout(function() { 182 if (!vars.is_paused){ 183 theme.progressBar(); 184 vars.slideshow_interval = setInterval(api.nextSlide, api.options.slide_interval); 185 } 186 vars.progressDelay = false; 187 }, 1000); 188 } 189 } 190 191 // Thumb Links 192 if (api.options.thumb_links && vars.thumb_tray.length){ 193 // Update Thumb Interval & Page 194 vars.thumb_page = 0;
195 vars.thumb_interval = Math.floor($(vars.thumb_tray).width() / $('> li', vars.thumb_list).outerWidth(true)) * $('> li', vars.thumb_list).outerWidth(true); 196 197 // Adjust thumbnail markers 198 if ($(vars.thumb_list).width() > $(vars.thumb_tray).width()){ 199 $(vars.thumb_back +','+vars.thumb_forward).fadeIn('fast'); 200 $(vars.thumb_list).stop().animate({'left':0}, 200); 201 }else{ 202 $(vars.thumb_back +','+vars.thumb_forward).fadeOut('fast'); 203 } 204 205 } 206 }); 207 208 209 }, 210 211 212 /* Go To Slide 213 ----------------------------*/ 214 goTo : function(){ 215 if (api.options.progress_bar && !vars.is_paused){ 216 $(vars.progress_bar).stop().animate({left : -$(window).width()}, 0 ); 217 theme.progressBar(); 218 } 219 }, 220 221 /* Play & Pause Toggle 222 ----------------------------*/ 223 playToggle : function(state){ 224 225 if (state =='play'){ 226 // If image, swap to pause 227 if ($(vars.play_button).attr('src')) $(vars.play_button).attr("src", api.options.image_path + "pause.png"); 228 if (api.options.progress_bar && !vars.is_paused) theme.progressBar(); 229 }else if (state == 'pause'){ 230 // If image, swap to play 231 if ($(vars.play_button).attr('src')) $(vars.play_button).attr("src", api.options.image_path + "play.png"); 232 if (api.options.progress_bar && vars.is_paused)$(vars.progress_bar).stop().animate({left : -$(window).width()}, 0 ); 233 } 234 235 }, 236 237 238 /* Before Slide Transition 239 ----------------------------*/ 240 beforeAnimation : function(direction){ 241 if (api.options.progress_bar && !vars.is_paused) $(vars.progress_bar).stop().animate({left : -$(window).width()}, 0 ); 242 243 244 $('#slidecaption').fadeOut('fast', function() { 245 /* Update Fields 246 ----------------------------*/ 247 // Update slide caption 248 if ($(vars.slide_caption).length){ 249 (api.getField('title')) ? $(vars.slide_caption).html(api.getField('title')) : $(vars.slide_caption).html(''); 250 } 251 }); 252 253 254 // Update slide number 255 if (vars.slide_current.length){ 256 $(vars.slide_current).html(vars.current_slide + 1); 257 } 258 259 260 // Highlight current thumbnail and adjust row position 261 if (api.options.thumb_links){ 262 263 $('.current-thumb').removeClass('current-thumb'); 264 $('li', vars.thumb_list).eq(vars.current_slide).addClass('current-thumb'); 265 266 // If thumb out of view 267 if ($(vars.thumb_list).width() > $(vars.thumb_tray).width()){ 268 // If next slide direction 269 if (direction == 'next'){ 270 if (vars.current_slide == 0){ 271 vars.thumb_page = 0; 272 $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); 273 } else if ($('.current-thumb').offset().left - $(vars.thumb_tray).offset().left >= vars.thumb_interval){ 274 vars.thumb_page = vars.thumb_page - vars.thumb_interval; 275 $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); 276 } 277 // If previous slide direction 278 }else if(direction == 'prev'){ 279 if (vars.current_slide == api.options.slides.length - 1){ 280 vars.thumb_page = Math.floor($(vars.thumb_list).width() / vars.thumb_interval) * -vars.thumb_interval; 281 if ($(vars.thumb_list).width() <= -vars.thumb_page) vars.thumb_page = vars.thumb_page + vars.thumb_interval; 282 $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); 283 } else if ($('.current-thumb').offset().left - $(vars.thumb_tray).offset().left < 0){ 284 if (vars.thumb_page + vars.thumb_interval > 0) return false; 285 vars.thumb_page = vars.thumb_page + vars.thumb_interval; 286 $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); 287 } 288 } 289 } 290 291 292 } 293 294 }, 295 296 297 /* After Slide Transition 298 ----------------------------*/ 299 afterAnimation : function(){ 300 $('#slidecaption').fadeIn(); 301 if (api.options.progress_bar && !vars.is_paused) theme.progressBar(); // Start progress bar 302 303 304 305 }, 306 307 308 /* Progress Bar 309 ----------------------------*/ 310 progressBar : function(){ 311 $(vars.progress_bar).stop().animate({left : -$(window).width()}, 0 ).animate({ left:0 }, api.options.slide_interval); 312 } 313 314 315 }; 316 317 /* Theme Specific Variables 318 ----------------------------*/ 319 $.supersized.themeVars = { 320 321 // Internal Variables 322 progress_delay : false, // Delay after resize before resuming slideshow 323 thumb_page : false, // Thumbnail page 324 thumb_interval : false, // Thumbnail interval 325 326 327 // General Elements 328 play_button : '#pauseplay', // Play/Pause button 329 next_slide : '#nextslide', // Next slide button 330 prev_slide : '#prevslide', // Prev slide button 331 next_thumb : '#nextthumb', // Next slide thumb button 332 prev_thumb : '#prevthumb', // Prev slide thumb button 333 334 slide_caption : '#slidecaption', // Slide caption 335 slide_current : '.slidenumber', // Current slide number 336 slide_total : '.totalslides', // Total Slides 337 slide_list : '#slide-list', // Slide jump list 338 339 thumb_tray : '#thumb-tray', // Thumbnail tray 340 thumb_list : '#thumb-list', // Thumbnail list 341 thumb_forward : '#thumb-forward', // Cycles forward through thumbnail list 342 thumb_back : '#thumb-back', // Cycles backwards through thumbnail list 343 tray_arrow : '#tray-arrow', // Thumbnail tray button arrow 344 tray_button : '#tray-button', // Thumbnail tray button 345 346 progress_bar : '#progress-bar' // Progress bar 347 348 }; 349 350 /* Theme Specific Options 351 ----------------------------*/ 352 $.supersized.themeOptions = { 353 354 progress_bar : 1, // Timer for each slide 355 mouse_scrub : 0 // Thumbnails move with mouse 356 357 }; 358 359 360})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.