1/* 2 File Name: script.js 3 by Tolga Can 4 RT-Theme 15 5*/ 6 7// Flex Slider and Helper Functions 8jQuery(window).load(function() { 9 10 if(rttheme_flex_slider_effect == "") rttheme_flex_slider_effect = "slide"; 11 12 if (jQuery('.flexslider.home_main').length>0){ 13 jQuery('.flexslider.home_main').flexslider({ 14 animation: ''+rttheme_flex_slider_effect+'', 15 slideshowSpeed:rttheme_slider_timeout, 16 smoothHeight: true, 17 directionNav: false, 18 before: function(slider){ 19 if(slider.width()>600){ 20 jQuery('.flexslider.home_main').find('.title,.text').css({'right':'-100px','opacity':'0'},0); 21 } 22 }, 23 after: function(slider){ 24 if(slider.width()>600){ 25 jQuery('.flexslider.home_main .flex-active-slide').find('.title').animate({'right':'0px','opacity':'1'},800,'easeOutBack'); 26 jQuery('.flexslider.home_main .flex-active-slide').find('.text').delay(300).animate({'right':'0px','opacity':'1'},800,'easeOutBack'); 27 }else{ 28 jQuery('.flexslider.home_main .flex-active-slide').find('.title').css({'right':'0px','opacity':'1'}); 29 jQuery('.flexslider.home_main .flex-active-slide').find('.text').css({'right':'0px','opacity':'1'}); 30 } 31 }, 32 start: function(slider){ 33 jQuery('body').removeClass('loading'); 34 } 35 }); 36 } 37 38 if (jQuery('.flexslider.shortcode').length>0){ 39 jQuery('.flexslider.shortcode').flexslider({ 40 animation: "fade", 41 directionNav: false, 42 smoothHeight: true, 43 start: function(slider){ 44 jQuery('body').removeClass('loading'); 45 } 46 }); 47 } 48}); 49 50// description fix 51jQuery(window).resize(function() { // description fix on window resize 52 jQuery('.flex-caption').css({'bottom':'0','opacity':'1'}); 53}); 54 55 56// Navigation Menu 57jQuery(document).ready(function (){ 58 //Usage 59 jQuery("#navigation ul li").menu({ 60 autohide: 0, 61 autostart: 1, 62 autostartSpeed: 0 63 }); 64}); 65 66 67// Cycle Slider 68jQuery(window).load(function() { 69 70 var slider_area; 71 var slider_buttons; 72 73 // Which slider 74 if (jQuery('#slider_area').length>0){ 75 76 // Home Page Slider 77 slider_area="#slider_area"; 78 slider_buttons="#numbers"; 79 80 jQuery(slider_area).cycle({ 81 fx: rttheme_slider_effect, // Effect 82 timeout: rttheme_slider_timeout, // Timeout value (ms) = 4 seconds 83 easing: 'backout', 84 pager: slider_buttons, 85 cleartype: 1, 86 after: onAfter , 87 before: onBefore, 88 pause: true, // true to enable "pause on hover" 89 pauseOnPagerHover: true, // true to pause when hovering over pager link 90 pagerAnchorBuilder: function(idx) { 91 return '<a href="#" title=""><img src="'+rttheme_template_dir+'/images/pixel.gif" width="8" heigth="8"></a>'; 92 } 93 }); 94 } 95 96 function onBefore() { 97 jQuery('#slider .text,#slider .title').css({opacity:0}); 98 } 99 100 function onAfter() { 101 jQuery('#slider .title').delay(0).animate({opacity:1},1200); 102 jQuery('#slider .text').delay(300).animate({opacity:1},600); 103 } 104}); 105 106 107//Nivo Slider 108jQuery(window).load(function() { 109 110 if (jQuery('#nivo-slider').length>0){ 111 jQuery('#nivo-slider').nivoSlider({ 112 pauseTime:rttheme_slider_timeout, // How long each slide will show 113 captionOpacity:1, 114 effect:rttheme_nivo_slider_effect, 115 controlNav: true 116 }); 117 } 118 119}); 120 121 122//pretty photo 123jQuery(document).ready(function(){ 124 jQuery("a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',slideshow:false,overlay_gallery: false,social_tools:false,deeplinking:false}); 125}); 126 127 128 129// Tabs 130jQuery(function() {// perform JavaScript after the document is scriptable. 131 jQuery("ul.tabs").tabs("> .pane", {effect: 'fade'}); 132 133 jQuery(".scrollable").scrollable(); 134 135 jQuery(".items.big_image img").click(function() { 136 137 // see if same thumb is being clicked 138 if (jQuery(this).hasClass("active")) { return; } 139 140 // calclulate large image's URL based on the thumbnail URL (flickr specific) 141 var url = jQuery(this).data("gal"); 142 143 // get handle to element that wraps the image and make it semi-transparent 144 var wrap = jQuery("#image_wrap").fadeTo("medium", 0.5); 145 146 // the large image from www.flickr.com 147 var img = new Image(); 148 149 150 // call this function after it's loaded 151 img.onload = function() { 152 153 // make wrapper fully visible 154 wrap.fadeTo("fast", 1); 155 156 // change the image 157 wrap.find("img").attr("src", url); 158 159 }; 160 161 // begin loading the image from www.flickr.com 162 img.src = url; 163 164 // activate item 165 jQuery(".items img").removeClass("active"); 166 jQuery(this).addClass("active"); 167 168 // when page loads simulate a "click" on the first image 169 }).filter(":first").click(); 170 171}); 172 173//RT Portfolio Effect 174jQuery(document).ready(function() { 175 176 var portfolio_item=jQuery("a.imgeffect"); 177 178 179 portfolio_item.each(function(){ 180 var imageClass = jQuery(this).attr("class"); // get the class 181 var theImage = jQuery(this).html(); // save the image 182 jQuery(this).find("img").addClass("active"); 183 jQuery(this).append('<span class="imagemask '+imageClass+'">'+theImage+'</span>'); //create new image within span 184 jQuery(this).find('span').parents('img').remove(); //remove image 185 }); 186 187 jQuery('a.imgeffect .active').remove(); //remove image 188 189 190 portfolio_item.mouseover(function(){ 191 jQuery(this).find('img').stop().animate({ top:"-22px" }, 100, "easeInQuad"); 192 }).mouseout(function(){ 193 jQuery(this).find('img').stop().animate({ top:"0" }, 100, "easeInQuad"); 194 }); 195 196}); 197 198 199 200 201//validate contact form 202jQuery(document).ready(function(){ 203 if(typeof jQuery.validator != 'undefined'){ 204 // show a simple loading indicator 205 var loader = jQuery('<img src=""+rttheme_template_dir+"images/loading.gif" alt="..." />') 206 .appendTo(".loading") 207 .hide(); 208 jQuery().ajaxStart(function() { 209 loader.show(); 210 }).ajaxStop(function() { 211 loader.hide(); 212 }).ajaxError(function(a, b, e) { 213 throw e; 214 }); 215 216 jQuery.validator.messages.required = ""; 217 var v = jQuery("#validate_form").validate({ 218 submitHandler: function(form) {
219 jQuery(form).ajaxSubmit({ 220 target: "#result" 221 }); 222 } 223 }); 224 225 jQuery("#reset").click(function() { 226 v.resetForm(); 227 }); 228 } 229}); 230 231 232//Slide to top 233jQuery(document).ready(function(){ 234 jQuery(".line span.top").click(function() { 235 jQuery('html, body').animate( { scrollTop: 0 }, 'slow' ); 236 }); 237}); 238 239 240//Social Media Icons 241if(!jQuery.browser.msie){ 242jQuery(function() { 243 jQuery('.social_media_icons img').each(function() { 244 jQuery(this).hover( 245 function() { 246 jQuery(this).stop().animate({ opacity: 1.0 }, 400); 247 }, 248 function() { 249 jQuery(this).stop().animate({ opacity: 0.3 }, 400); 250 }) 251 }); 252 }); 253} 254 255/* Popoye Slider */ 256jQuery(document).ready(function () { 257 var options = { 258 caption:'hover', 259 opacity:0.7, 260 easing:'easeIn', 261 zindex:20000 262 } 263 jQuery('.ppy').popeye(options); 264}); 265 266 267/* tool tips */ 268jQuery(document).ready(function(){ 269 jQuery('.j_ttip').colorTip({color:'white'}); 270 jQuery('.j_ttip2').colorTip({color:'black'}); 271}); 272 273//RT form field - text back function 274jQuery(document).ready(function() { 275 276var form_inputs=jQuery(".showtextback"); 277 278 form_inputs.each(function(){ 279 280 jQuery(this).focus( function() 281 { 282 val = jQuery(this).val(); 283 if (jQuery(this).attr("alt") != "0"){ 284 jQuery(this).attr("alt",jQuery(this).attr("value")); 285 jQuery(this).attr("value",""); 286 } 287 }); 288 289 jQuery(this).blur( function(){ 290 if (jQuery(this).attr("alt") != "0"){ 291 val = jQuery(this).val(); 292 if (val == '' || val == jQuery(this).attr("alt")){ 293 jQuery(this).attr("value",jQuery(this).attr("alt")); 294 } 295 } 296 }); 297 298 jQuery(this).keypress( function(){ 299 jQuery(this).attr("alt","0"); 300 }); 301 }); 302 303}); 304 305 306 /* 307 * jQuery Easing Compatibility v1 - http://gsgd.co.uk/sandbox/jquery.easing.php 308 * 309 * Adds compatibility for applications that use the pre 1.2 easing names 310 * 311 * Copyright (c) 2007 George Smith 312 * Licensed under the MIT License: 313 * http://www.opensource.org/licenses/mit-license.php 314 */ 315 316// check easing names 317(function($){ 318 if(typeof easeIn != 'function'){ 319 320 jQuery.extend( jQuery.easing, 321 { 322 easeIn: function (x, t, b, c, d) { 323 return jQuery.easing.easeInQuad(x, t, b, c, d); 324 }, 325 easeOut: function (x, t, b, c, d) { 326 return jQuery.easing.easeOutQuad(x, t, b, c, d); 327 }, 328 easeInOut: function (x, t, b, c, d) { 329 return jQuery.easing.easeInOutQuad(x, t, b, c, d); 330 }, 331 expoin: function(x, t, b, c, d) { 332 return jQuery.easing.easeInExpo(x, t, b, c, d); 333 }, 334 expoout: function(x, t, b, c, d) { 335 return jQuery.easing.easeOutExpo(x, t, b, c, d); 336 }, 337 expoinout: function(x, t, b, c, d) { 338 return jQuery.easing.easeInOutExpo(x, t, b, c, d); 339 }, 340 bouncein: function(x, t, b, c, d) { 341 return jQuery.easing.easeInBounce(x, t, b, c, d); 342 }, 343 bounceout: function(x, t, b, c, d) { 344 return jQuery.easing.easeOutBounce(x, t, b, c, d); 345 }, 346 bounceinout: function(x, t, b, c, d) { 347 return jQuery.easing.easeInOutBounce(x, t, b, c, d); 348 }, 349 elasin: function(x, t, b, c, d) { 350 return jQuery.easing.easeInElastic(x, t, b, c, d); 351 }, 352 elasout: function(x, t, b, c, d) { 353 return jQuery.easing.easeOutElastic(x, t, b, c, d); 354 }, 355 elasinout: function(x, t, b, c, d) { 356 return jQuery.easing.easeInOutElastic(x, t, b, c, d); 357 }, 358 backin: function(x, t, b, c, d) { 359 return jQuery.easing.easeInBack(x, t, b, c, d); 360 }, 361 backout: function(x, t, b, c, d) { 362 return jQuery.easing.easeOutBack(x, t, b, c, d); 363 }, 364 backinout: function(x, t, b, c, d) { 365 return jQuery.easing.easeInOutBack(x, t, b, c, d); 366 } 367 }); 368 369 } 370})(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.