1/** 2 * Functionality specific to flat_responsive. 3 * 4 * Provides helper functions to enhance the theme experience. 5 */ 6 7( function( $ ) { 8 var body = $( 'body' ), 9 _window = $( window ); 10 11 12 /** 13 * Enables menu toggle for small screens. 14 */ 15 ( function() { 16 var nav = $( '#site-navigation' ), button, menu; 17 if ( ! nav ) 18 return; 19 20 button = nav.find( '.menu-toggle' ); 21 if ( ! button ) 22 return; 23 24 // Hide button if menu is missing or empty. 25 menu = nav.find( '.nav-menu' ); 26 if ( ! menu || ! menu.children().length ) { 27 button.hide(); 28 return; 29 } 30 31 $( '.menu-toggle' ).on( 'click.flat_responsive', function() { 32 nav.toggleClass( 'toggled-on' ); 33 } ); 34 } )(); 35 36 37 38 39 /** 40 * Enables secondary menu toggle for small screens. 41 */ 42 ( function() { 43 var nav = $( '#site-navigation2' ), button, menu; 44 if ( ! nav ) 45 return; 46 47 button = nav.find( '.menu-toggle2' ); 48 if ( ! button ) 49 return; 50 51 // Hide button if menu is missing or empty. 52 menu = nav.find( '.nav-menu' ); 53 if ( ! menu || ! menu.children().length ) { 54 button.hide(); 55 return; 56 } 57 58 $( '.menu-toggle2' ).on( 'click.flat_responsive', function() { 59 nav.toggleClass( 'toggled-on2' ); 60 } ); 61 } )(); 62 63 64 /* 65 * Makes "skip to content" link work correctly in IE9 and Chrome for better 66 * accessibility. 67 * 68 * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/ 69 */ 70 _window.on( 'hashchange.flat_responsive', function() { 71 var element = document.getElementById( location.hash.substring( 1 ) ); 72 73 if ( element ) { 74 if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) { 75 element.tabIndex = -1; 76 } 77 78 element.focus(); 79 80 // Repositions the window on jump-to-anchor to account for header height. 81 window.scrollBy( 0, -80 ); 82 } 83 } ); 84 85 86( function() { 87 var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1, 88 is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, 89 is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; 90 91 if ( ( is_webkit || is_opera || is_ie ) && 'undefined' !== typeof( document.getElementById ) ) { 92 var eventMethod = ( window.addEventListener ) ? 'addEventListener' : 'attachEvent'; 93 window[ eventMethod ]( 'hashchange', function() { 94 var element = document.getElementById( location.hash.substring( 1 ) ); 95 96 if ( element ) { 97 if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) 98 element.tabIndex = -1; 99 100 element.focus(); 101 } 102 }, false ); 103 } 104})(); 105 106 107// lets add some bootstrap styling to WordPress elements starting with the tables 108 109jQuery(function($){ 110 //$( 'table' ).addClass( 'table' ); 111 $( '#submit' ).addClass( 'btn btn-sm' ); 112 $( 'a.button' ).removeAttr('class').addClass( 'btn btn-sm'); 113 $( '.button' ).removeAttr('class').addClass( 'btn btn-sm'); 114 $('#submit').removeAttr('id'); 115 116 117 $( '#bbpress-forums button' ).addClass( 'btn btn-sm' ); 118 $( '#bbp_search_submit').addClass( 'btn' ); 119 $( '#bbp_search' ).addClass( 'form-control' ); 120 $( '#bbp-search-form' ).addClass( 'input-group' ); 121 $( '#bbp_topic_title' ).addClass( 'form-control' ); 122 $( '#bbp_topic_content' ).addClass( 'form-control' ); 123 $( '#bbp_topic_tags' ).addClass( 'form-control' ); 124 $( '#bbpress-forums select' ).addClass( 'form-control' ); 125 $( '#bbp_topic_submit', '.subscription-toggle' ).addClass( 'btn' ); 126 $( '.subscription-toggle' ).addClass( 'btn btn-sm' ); 127 $( '#bbp_anonymous_author' ).addClass( 'form-control col-md-6' ); 128 $( '#bbp_anonymous_email' ).addClass( 'form-control col-md-6' ); 129 $( '#bbp_anonymous_website' ).addClass( 'form-control col-md-6' ); 130 131}); 132 133} )( jQuery ); 134 135(function ($) { 136 137 138 139 140 141 //Rating icons Show on Hover on Product 142 $(".woocommerce_product_list_single").mouseover(function(){ 143 var rating_width = $('.rating').width(); 144 var image_width = $('.woocommerce_product_list_single').width(); 145 var margin_right_for_rating1 = image_width/2 - 70; 146 var margin_right_for_rating = margin_right_for_rating1;
147 $(this).find(".rating").css({'marginLeft': margin_right_for_rating, 'display':'block'}); 148 }).mouseleave(function(){ 149 $(".rating").hide(); 150 }); 151 152 153 //Replacing image on the main product when clicking on the thumbnails 154 $(".zoom_thumbnails_image").click(function(){ 155 var href= $(this).attr('link'); 156 $(".attachment-shop_single").removeAttr('src'); 157 $(".woocommerce-main-image").removeAttr('href'); 158 $(".attachment-shop_single").removeAttr('data-zoom-image'); 159 $(".attachment-shop_single").attr('data-zoom-image', href); 160 $(".woocommerce-main-image").attr('href', href); 161 $(".attachment-shop_single").attr('src', href); 162 $(".zoomWindow").css('background-image', 'url(' + href + ')'); 163 $(".zoomContainer").css('height','auto'); 164 }); 165 166 //thumbnail change on click single product 167 var current_thumbnail_image_url =""; 168 $(".woocommerce_product_list_single").mouseover(function(){ 169 current_thumbnail_image_url = $(this).find(".wp-post-image").attr('src'); 170 171 var new_thumbnail_image_url = $(this).find(".thumbnail_jquery_effect img").attr('src'); 172 if (new_thumbnail_image_url == null) { 173 174 } 175 else { 176 $(this).find(".wp-post-image").removeAttr('src'); 177 $(this).find(".wp-post-image").attr('src', new_thumbnail_image_url); 178 } 179 180 }).mouseleave(function(){ 181 $(this).find(".wp-post-image").attr('src', current_thumbnail_image_url); 182 183 }); 184 185 186 //category listing animation of title 187 $(".woocommerce_category_list_single").mouseover(function(){ 188 $(this).find(".woocommerce_category_product_title").animate({'marginTop':'-40px', 'opacity': '0.6'},500); 189 }).mouseleave(function(){ 190 $(this).find(".woocommerce_category_product_title").animate({'marginTop':'-107px', 'opacity': '1'},500); 191 }); 192 193 194 //button change on click in woocommerce 195 $(".ajax_woocommerce").click(function(){ 196 $(".ajax_woocommerce").show(); 197 $(this).hide(); 198 199 }); 200 201 202 /* 203 ================================================= 204 LIST DESIGN 205 ================================================= 206 */ 207 var list_icon = $('') 208 209 210 211 //cart icon change in primary menu 212 var window_width = $(window).width(); 213 var content = $('li.cart-icon').find('a'); 214 var content_first = $('li.cart-icon').find('a').html(); 215 if (window_width > 960) { 216 $(content).html('<i class="fa fa-check"></i>'); 217 } 218 else { 219 $(content).html(content_first); 220 } 221 222 223 //clearing div clear:both method for images 224 225 226 //menu jquery efffect 227 //menu-toggle effect 228 229 var window_width = ''; 230 231 if (window_width < 1000) { 232 var children_link = $('ul.mobilemenu').find('li.menu-item-has-children > a'); 233 var children_link_main = $('ul.mobilemenu').find('li.menu-item-has-children'); 234 $(children_link_main).prepend('<i class="fa fa-plus"></i>  '); 235 236 $('li.menu-item-has-children > .fa').on( 'click', function() { 237 $(this).parent('li.menu-item-has-children').toggleClass('expanded'); 238 $(this).toggleClass('fa-minus'); 239 }); 240 241 // $(children_link_main).mouseover(function(){ 242 // $(this).find('a').first().find('i').removeClass('fa-plus'); 243 // $(this).find('a').first().find('i').addClass('fa-minus'); 244 // }).mouseleave(function() { 245 // $(this).find('a').first().find('i').removeClass('fa-minus'); 246 // $(this).find('a').first().find('i').addClass('fa-plus'); 247 // }); 248 249 $('.toggle_button_flat_responsive_menu').click(function(){ 250 $('ul.mobilemenu').toggle(); 251 $('ul.mobilemenu').css('overflow-x','hidden'); 252 }); 253 } 254 255 256 257 258 //Scroll To Top 259 var window_height = $(window).height(); 260 var window_height = (window_height) + (50); 261 262 263 264 $(window).scroll(function() { 265 var scroll_top = $(window).scrollTop(); 266 if (scroll_top > window_height) { 267 $('.flat_responsive_move_to_top').show(); 268 } 269 else { 270 $('.flat_responsive_move_to_top').hide(); 271 } 272 }); 273 $('.flat_responsive_move_to_top').click(function(){ 274 $('html, body').animate({scrollTop:0}, 'slow'); 275 return false; 276 277 }); 278 279 280 281 $(window).scroll(function(){ 282 283 //floating social styles 284 var window_top= $(window).scrollTop(); 285 var window_height= $(window).height(); 286 var social_icons_height = $('.social_bar_float_with_screen').height(); 287 var social_bar_margin_height = (window_top) + (window_height) / 4; 288 $('.social_bar_float_with_screen').animate({'marginTop': (social_bar_margin_height)},0); 289 290 291 });
292 293 294/* 295============================================================ 296@ Icons 297============================================================ 298*/ 299 300 301/* 302============================================================ 303@ Tabs 304============================================================ 305*/ 306 $('.btn').mouseover(function(){ 307 var hover = $(this).data('hov'); 308 var color = $(this).data('col'); 309 var colorbg = $(this).data('colbg'); 310 var hoverbg = $(this).data('hovbg'); 311 $(this).css({'background-color': hoverbg, 'color': hover}); 312 }).mouseleave(function(){ 313 var hover = $(this).data('hov'); 314 315 var color = $(this).data('col'); 316 var colorbg = $(this).data('colbg'); 317 var hoverbg = $(this).data('hovbg'); 318 $(this).css({'background-color': colorbg, 'color': color}); 319 }); 320 321 322 323 324/* 325============================================================ 326@ WOW.JS 327============================================================ 328*/ 329 330 331 332/* 333================================================= 334Search Icon 335================================================= 336*/ 337 338 339 340 341})(jQuery); 342
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.