PageSourceSearch

https://www.42u.com/wp-content/themes/circumference/js/circumference-extras.js?ver=2026-09-20%2013%3A19%3A42

js 42u.com collected 2026-09-24 23:26:03 UTC 8,004 bytes, 265 lines download raw bytes

1/**
2 * Functionality specific to Circumference.
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.circumference', 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.circumference', 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.circumference', 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	$('.woocommerce_submit_button').addClass('button');
111	//$('.woocommerce .wsb_primary').addClass('btn');
112	//$('.woocommerce .submit').addClass('wsb_primary').addClass('btn').removeClass('submit');
113	$( '#bbpress-forums button' ).addClass( 'btn btn-sm' );
114	$( '#bbp_search_submit').addClass( 'btn' );
115	$( '#bbp_search' ).addClass( 'form-control' );
116	$( '#bbp-search-form' ).addClass( 'input-group' );
117	$( '#bbp_topic_title' ).addClass( 'form-control' );
118	$( '#bbp_topic_content' ).addClass( 'form-control' );
119	$( '#bbp_topic_tags' ).addClass( 'form-control' );
120	$( '#bbpress-forums select' ).addClass( 'form-control' );
121	$( '#bbp_topic_submit', '.subscription-toggle' ).addClass( 'btn' );
122	$( '.subscription-toggle' ).addClass( 'btn btn-sm' );
123	$( '#bbp_anonymous_author' ).addClass( 'form-control col-md-6' );
124	$( '#bbp_anonymous_email' ).addClass( 'form-control col-md-6' );
125	$( '#bbp_anonymous_website' ).addClass( 'form-control col-md-6' );
126	
127});
128	
129} )( jQuery );
130
131(function  ($) {
132
133	//carausol for product gallery images on single product
134	$(".product_thumbnails").jCarouselLite({
135	    btnNext: ".product_thumbnails_next",
136    	btnPrev: ".product_thumbnails_prev",
137	});
138
139	//deactivate zoom of main single product image in mobile view
140	var window_width = $(window).width();
141	if (window_width > 768) {
142		$(".attachment-shop_single").elevateZoom({ 
143		gallery : "gallery_09", galleryActiveClass: "active" 
144		});
145	}
146
147	//Rating icons Show on Hover on Product
148	$(".woocommerce_product_list_single").mouseover(function(){
149   		
150	   		var rating_width = $('.rating').width();
151		 	var image_width = $('.woocommerce_product_list_single').width();
152		 	var margin_right_for_rating1 =  image_width/2 - 70;
153		 	console.log(margin_right_for_rating1);
154			var margin_right_for_rating =  margin_right_for_rating1;
155			$(this).find(".rating").css({'marginLeft': margin_right_for_rating, 'display':'block'});
156			
157	}).mouseleave(function(){
158		$(".rating").hide();
159	});
160	
161
162	//Replacing image on the main product when clicking on the thumbnails
163	$(".zoom_thumbnails_image").click(function(){
164		var href= $(this).attr('link');
165		$(".attachment-shop_single").removeAttr('src');
166		$(".woocommerce-main-image").removeAttr('href');
167		$(".attachment-shop_single").removeAttr('data-zoom-image');
168		$(".attachment-shop_single").attr('data-zoom-image', href);
169		$(".woocommerce-main-image").attr('href', href);
170		$(".attachment-shop_single").attr('src', href);
171		$(".zoomWindow").css('background-image', 'url(' + href + ')');
172		$(".zoomContainer").css('height','auto');		
173	});
174
175	//thumbnail change on click single product
176	var current_thumbnail_image_url ="";
177	$(".woocommerce_product_list_single").mouseover(function(){
178		current_thumbnail_image_url = $(this).find(".wp-post-image").attr('src');
179		
180		var new_thumbnail_image_url = $(this).find(".thumbnail_jquery_effect img").attr('src');
181		if (new_thumbnail_image_url == null) {
182			
183		}
184		else {
185			$(this).find(".wp-post-image").removeAttr('src');
186			$(this).find(".wp-post-image").attr('src', new_thumbnail_image_url);
187		}
188	
189	}).mouseleave(function(){
190		$(this).find(".wp-post-image").attr('src', current_thumbnail_image_url);
191
192	});
193
194
195	//category listing animation of title
196	$(".woocommerce_category_list_single").mouseover(function(){
197		$(this).find(".woocommerce_category_product_title").animate({'marginTop':'-40px', 'opacity': '0.6'},500);
198	}).mouseleave(function(){
199		$(this).find(".woocommerce_category_product_title").animate({'marginTop':'-107px', 'opacity': '1'},500);
200	});
201
202
203	//button change on click in woocommerce
204	$(".ajax_woocommerce").click(function(){
205		$(this).removeClass('wsb_lg');
206		$(this).html('<i class="fa fa-check"></i>');
207	})
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-shopping-cart fa-lg"></i>');
217	}
218	else {
219		$(content).html(content_first);
220	}
221
222
223	//content and product scroll on large screens
224	var window_width = $(window).width();
225	if (window_width > 960) {
226		$(".woocommerce columns-4").jCarouselLite({
227	    btnNext: ".product_thumbnails_next",
228    	btnPrev: ".product_thumbnails_prev",
229	});
230		$('.cir-search-bottom').show();
231	}
232
233	//clearing div clear:both method for images 
234
235	//adding move to top featured
236
237    //Scroll To Top
238    var window_height = $(window).height();
239    var window_height = (window_height) + (50);
240    
241    
242
243    $(window).scroll(function() {
244        var scroll_top = $(window).scrollTop();
245        if (scroll_top > window_height) {
246            $('.circumference_move_to_top').show();
247        }
248        else {
249            $('.circumference_move_to_top').hide();   
250        }
251    });
252    $('.circumference_move_to_top').click(function(){
253        $('html, body').animate({scrollTop:0}, 'slow');
254        return false;
255        
256    });
257    //making of search bottom
258	$( '.cir-search-bottom' ).click(function() {
259		$('.cir-overlay-form' ).show();
260	});
261	$( '#cancel-search-form' ).click(function() {
262		$('.cir-overlay-form' ).hide();
263	});
264
265})(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.