1// et_switcher plugin v2.2 2(function($) 3{ 4 $.fn.et_shortcodes_switcher = function(options) 5 { 6 var defaults = 7 { 8 slides: '>div', 9 activeClass: 'active', 10 linksNav: '', 11 findParent: true, //use parent elements to define active states 12 lengthElement: 'li', //parent element, used only if findParent is set to true 13 useArrows: false, 14 arrowLeft: 'a#prev-arrow', 15 arrowRight: 'a#next-arrow', 16 auto: false, 17 autoSpeed: 5000, 18 slidePadding: '', 19 pauseOnHover: true, 20 fx: 'fade', 21 sliderType: '' 22 }; 23 24 var options = $.extend(defaults, options); 25 26 return this.each(function() 27 { 28 29 var slidesContainer = jQuery(this).parent().css('position','relative'), 30 $slides = jQuery(this).css({'overflow':'hidden','position':'relative'}), 31 $slide = $slides.find(options.slides).css({'opacity':'1','position':'absolute','top':'0px','left':'0px','display':'none'}), 32 slidesNum = $slide.length, 33 zIndex = slidesNum, 34 currentPosition = 1, 35 slideHeight = 0, 36 $activeSlide, 37 $nextSlide, 38 $et_learn_more_button = $slides.find('.et-learn-more .heading-more'); 39 40 if (options.fx === 'slide') { 41 $slide.css({'opacity':'0','position':'absolute','top':'0px','left':'0px','display':'none'}); 42 } 43 if (options.sliderType === 'images'){ 44 $slide.css({'display':'block'}); 45 if (options.fx === 'fade') $slide.filter(':not(:first)').css({'display':'none'}); 46 } 47 48 $slide.filter(':first').css({'display':'block'}).addClass('et_shortcode_slide_active'); 49 50 if (options.slidePadding != '') $slide.css('padding',options.slidePadding); 51 52 $slide.each(function(){ 53 jQuery(this).css('z-index',zIndex).addClass('clearfix'); 54 if (options.fx === 'slide') zIndex--; 55 }); 56 57 slideHeight = $slide.filter(':first').innerHeight(); 58 59 slidesContainer.find('.et-learn-more').not('.et-open').find('.learn-more-content').css({'display':'none','visibility': 'visible'}); 60 61 et_change_container_height( slideHeight, 400 ); 62 63 var slideWidth = $slide.width(), 64 slideOuterWidth = $slide.outerWidth(); 65 66/* 67 if ( jQuery.browser.msie && !slidesContainer.hasClass('et-simple-slider') ) { 68 $slide.css('width',slideWidth-22); 69 } else { 70 $slide.css('width',slideWidth); 71 } 72*/ 73 74 $slide.filter(':first').css('opacity','1'); 75 76 if (options.sliderType != '') { 77 if (options.sliderType === 'images') { 78 controllersHtml = '<div class="controllers-wrapper"><div class="controllers"><a href="#" class="left-arrow">Previous</a>'; 79 for ($i=1; $i<=slidesNum; $i++) { 80 controllersHtml += '<a class="switch" href="#">'+$i+'</a>'; 81 } 82 controllersHtml += '<a href="#" class="right-arrow">Next</a></div><div class="controllers-right"></div></div>'; 83 $controllersWrap = jQuery(controllersHtml).prependTo($slides.parent()); 84 slidesContainer.find('.controllers-wrapper .controllers').css('width', 65 + 18*slidesNum); 85 } 86 87 var etimage_width = $slide.width(); 88 89 slidesContainer.css({'width':'auto'}); 90 $slides.css({'width':'auto'}); 91 92 if (options.sliderType === 'images') { 93 slidesContainer.css({'width':etimage_width}); 94 $slides.css({'width':etimage_width}); 95 96 slidesContainer.css({'height':$slide.height()}); 97 $slides.css({'height':$slide.height()}); 98 99 var controllers_width = $controllersWrap.innerWidth(); 100 101 $controllersWrap.css({ 'margin-left' : '-' + (controllers_width / 2) + 'px' }); 102 } 103 } 104 105 106 if (options.linksNav != '') { 107 var linkSwitcher = jQuery(options.linksNav); 108 109 var linkSwitcherTab = ''; 110 if (options.findParent) linkSwitcherTab = linkSwitcher.parent(); 111 else linkSwitcherTab = linkSwitcher; 112 113 if (!linkSwitcherTab.filter('.active').length) linkSwitcherTab.filter(':first').addClass('active'); 114 115 linkSwitcher.click(function(){ 116 117 var targetElement; 118 119 if (options.findParent) targetElement = jQuery(this).parent(); 120 else targetElement = jQuery(this); 121 122 var orderNum = targetElement.prevAll(options.lengthElement).length+1; 123 124 if (orderNum >
124 currentPosition) gotoSlide(orderNum, 1); 125 else gotoSlide(orderNum, -1); 126 127 return false; 128 }); 129 } 130 131 132 if (options.useArrows) { 133 var $right_arrow = jQuery(options.arrowRight), 134 $left_arrow = jQuery(options.arrowLeft); 135 136 $right_arrow.click(function(){ 137 if (currentPosition === slidesNum) 138 gotoSlide(1,1); 139 else 140 gotoSlide(currentPosition+1),1; 141 142 if (options.linksNav != '') changeTab(); 143 144 return false; 145 }); 146 147 $left_arrow.click(function(){ 148 if (currentPosition === 1) 149 gotoSlide(slidesNum,-1); 150 else 151 gotoSlide(currentPosition-1,-1); 152 153 if (options.linksNav != '') changeTab(); 154 155 return false; 156 }); 157 158 } 159 160 $et_learn_more_button.click( function(){ 161 var $this_slide = jQuery(this).closest('.et_slidecontent'); 162 163 if ( $(this).hasClass('open') ) 164 $(this).removeClass('open'); 165 else 166 $(this).addClass('open'); 167 168 $(this).parent('.et-learn-more').find('.learn-more-content').animate({ opacity: 'toggle', height: 'toggle' }, 300, function(){ 169 et_change_container_height( $this_slide.innerHeight(), 50 ); 170 }); 171 } ); 172 173 function et_change_container_height( new_height, speed ){ 174 $slides.css('width', 'auto'); 175 176 //check left tabs container height 177 if ( slidesContainer.hasClass('tabs-left') ) { 178 var leftTabsHeight = slidesContainer.find('ul.et-tabs-control').innerHeight(); 179 if ( leftTabsHeight > new_height ) new_height = leftTabsHeight; 180 } 181 182 if ( jQuery.browser.msie ) { 183 //if ( slidesContainer.hasClass('et-simple-slider') ) $slides.css('height', new_height+10); 184 //else $slides.css('height', new_height+40); 185 $slides.css('height', new_height); 186 } else { 187 $slides.animate( { 'height' : new_height }, speed ); 188 } 189 } 190 191 function changeTab(){ 192 if (linkSwitcherTab != '') { 193 linkSwitcherTab.siblings().removeClass('active'); 194 linkSwitcherTab.filter(':eq('+(currentPosition-1)+')').addClass('active'); 195 } 196 } 197
198 function gotoSlide(slideNumber,dir){ 199 if ($slide.filter(':animated').length) return; 200 201 $slide.css('opacity','0'); 202 203 $activeSlide = $slide.filter(':eq('+(currentPosition-1)+')').css('opacity','1'); 204 205 if (currentPosition === slideNumber) return; 206 207 $activeSlide.removeClass('et_shortcode_slide_active'); 208 209 $nextSlide = $slide.filter(':eq('+(slideNumber-1)+')').css('opacity','1').addClass('et_shortcode_slide_active'); 210 211 if ((currentPosition > slideNumber || currentPosition === 1) && (dir === -1)) { 212 if (options.fx === 'slide') slideBack(500); 213 if (options.fx === 'fade') slideFade(500); 214 } else { 215 if (options.fx === 'slide') slideForward(500); 216 if (options.fx === 'fade') slideFade(500); 217 } 218 219 currentPosition = $nextSlide.prevAll().length + 1; 220 221 if (options.linksNav != '') changeTab(); 222 223 return false; 224 } 225 226 227 if (options.auto) { 228 auto_rotate(); 229 var pauseSlider = false; 230 } 231 232 if (options.pauseOnHover) { 233 slidesContainer.hover(function(){ 234 pauseSlider = true; 235 },function(){ 236 pauseSlider = false;
237 }); 238 } 239 240 function auto_rotate(){ 241 242 interval_shortcodes = setInterval(function(){ 243 if (!pauseSlider) { 244 if (currentPosition === slidesNum) 245 gotoSlide(1,1); 246 else 247 gotoSlide(currentPosition+1,1); 248 249 if (options.linksNav != '') changeTab(); 250 } 251 },options.autoSpeed); 252 } 253 254 function slideFade(speed){ 255 $activeSlide.css({zIndex: slidesNum}).fadeOut(400, function(){ 256 if ( options.sliderType !== 'images' ){ 257 $activeSlide.css('opacity',0); 258 $nextSlide.css({zIndex: (slidesNum+1), 'display':'block'}).fadeIn(400); 259 } 260 }); 261 if ( options.sliderType === 'images' ) $nextSlide.css({zIndex: (slidesNum+1), 'display' : 'none'}).fadeIn(400); 262 et_change_container_height( $nextSlide.innerHeight(), 500 ); 263 } 264 265 function slideForward(speed){ 266 $nextSlide.css('left',slideOuterWidth+'px'); 267 268 if (options.sliderType === 'images'){ 269 $activeSlide.animate({left: '-'+slideOuterWidth},speed); 270 } else { 271 $activeSlide.animate({left: '-'+slideOuterWidth,opacity:0},speed); 272 $nextSlide.css('display','block'); 273 } 274 275 $nextSlide.animate({left: 0,opacity:1},speed); 276 et_change_container_height( $nextSlide.innerHeight(), speed ); 277 } 278 279 function slideBack(speed){ 280 $nextSlide.css('left','-'+slideOuterWidth+'px'); 281 282 if (options.sliderType === 'images'){ 283 $activeSlide.animate({left: slideOuterWidth},speed); 284 } else { 285 $activeSlide.animate({left: slideOuterWidth,opacity:0},speed); 286 $nextSlide.css('display','block'); 287 } 288 289 $nextSlide.animate({left: 0,opacity:1},speed); 290 et_change_container_height( $nextSlide.innerHeight(), speed ); 291 } 292 293 }); 294 } 295})(jQuery); 296// end et_switcher plugin v2 297 298/////// Shortcodes Javascript /////// 299jQuery(document).ready(function($){ 300 $et_tooltip = $('.et-tooltip'); 301 $et_tooltip.live('mouseover mouseout', function(event){ 302 if (event.type == 'mouseover') { 303 $(this).find('.et-tooltip-box').animate({ opacity: 'show', bottom: '25px' }, 300); 304 } else { 305 $(this).find('.et-tooltip-box').animate({ opacity: 'hide', bottom: '35px' }, 300); 306 } 307 }); 308 // learn more 309 $et_learn_more = $('.et-learn-more .heading-more'); 310 $et_learn_more.live('click', function() { 311 if ( $(this).closest('.et_slidecontent').length ) return; 312 313 if ( $(this).hasClass('open') ) 314 $(this).removeClass('open'); 315 else 316 $(this).addClass('open'); 317 318 $(this).parent('.et-learn-more').find('.learn-more-content').animate({ opacity: 'toggle', height: 'toggle' }, 300, function(){ 319 var et_hidden_div_height, 320 $et_hidden_tabs = $(this).find('.et-tabs-content,.et-simple-slides'); 321 322 if ( $et_hidden_tabs.length ){ 323 et_hidden_div_height = $et_hidden_tabs.find('>div:visible').innerHeight(); 324 $et_hidden_tabs.css( 'height', et_hidden_div_height ); 325 } 326 }); 327 }); 328 329 $('.et-learn-more').not('.et-open').find('.learn-more-content').css( { 'visibility' : 'visible', 'display' : 'none' } ); 330 331 var $et_shortcodes_tabs = $('.et-tabs-container, .tabs-left, .et-simple-slider, .et-image-slider'); 332 $et_shortcodes_tabs.each(function(i){ 333 var et_shortcodes_tab_class = $(this).attr('class'), 334 et_shortcodes_tab_autospeed_class_value = /et_sliderauto_speed_(\d+)/g, 335 et_shortcodes_tab_autospeed = et_shortcodes_tab_autospeed_class_value.exec( et_shortcodes_tab_class ), 336 et_shortcodes_tab_auto_class_value = /et_sliderauto_(\w+)/g, 337 et_shortcodes_tab_auto = et_shortcodes_tab_auto_class_value.exec( et_shortcodes_tab_class ), 338 et_shortcodes_tab_type_class_value = /et_slidertype_(\w+)/g, 339 et_shortcodes_tab_type = et_shortcodes_tab_type_class_value.exec( et_shortcodes_tab_class ), 340 et_shortcodes_tab_fx_class_value = /et_sliderfx_(\w+)/g, 341 et_shortcodes_tab_fx = et_shortcodes_tab_fx_class_value.exec( et_shortcodes_tab_class ), 342 et_shortcodes_tab_apply_to_element = '.et-tabs-content', 343 et_shortcodes_tab_settings = {}; 344 345 et_shortcodes_tab_settings.linksNav = $(this).find('.et-tabs-control li a'); 346 et_shortcodes_tab_settings.findParent = true; 347 et_shortcodes_tab_settings.fx = et_shortcodes_tab_fx[1];
348 et_shortcodes_tab_settings.auto = 'false' === et_shortcodes_tab_auto[1] ? false : true; 349 et_shortcodes_tab_settings.autoSpeed = et_shortcodes_tab_autospeed[1]; 350 351 if ( 'top_tabs' === et_shortcodes_tab_type[1] ) { 352 et_shortcodes_tab_settings.slidePadding = '20px 25px 15px'; 353 } else if ( 'simple' === et_shortcodes_tab_type[1] ){ 354 et_shortcodes_tab_settings = {}; 355 et_shortcodes_tab_settings.fx = et_shortcodes_tab_fx[1]; 356 et_shortcodes_tab_settings.auto = 'false' === et_shortcodes_tab_auto[1] ? false : true; 357 et_shortcodes_tab_settings.autoSpeed = et_shortcodes_tab_autospeed[1]; 358 et_shortcodes_tab_settings.sliderType = 'simple'; 359 et_shortcodes_tab_settings.useArrows = true; 360 et_shortcodes_tab_settings.arrowLeft = $(this).find('a.et-slider-leftarrow'); 361 et_shortcodes_tab_settings.arrowRight = $(this).find('a.et-slider-rightarrow'); 362 et_shortcodes_tab_apply_to_element = '.et-simple-slides'; 363 } else if ( 'images' === et_shortcodes_tab_type[1] ){ 364 et_shortcodes_tab_settings.sliderType = 'images'; 365 et_shortcodes_tab_settings.linksNav = '#' + $(this).attr('id') + ' .controllers a.switch'; 366 et_shortcodes_tab_settings.useArrows = true; 367 et_shortcodes_tab_settings.arrowLeft = '#' + $(this).attr('id') + ' a.left-arrow'; 368 et_shortcodes_tab_settings.arrowRight = '#' + $(this).attr('id') + ' a.right-arrow';; 369 et_shortcodes_tab_settings.findParent = false; 370 et_shortcodes_tab_settings.lengthElement = '#' + $(this).attr('id') + ' a.switch'; 371 et_shortcodes_tab_apply_to_element = '.et-image-slides'; 372 } 373 374 $(this).find(et_shortcodes_tab_apply_to_element).et_shortcodes_switcher( et_shortcodes_tab_settings ); 375 }); 376});
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.