PageSourceSearch

https://www.roomfour.com.au/wp-content/themes/Roomfour/assets/js/main.js?ver=1790195184

js roomfour.com.au collected 2026-10-06 02:46:52 UTC 6,778 bytes, 241 lines download raw bytes

1(function($) {
2
3	'use strict';
4
5	$(function() {
6
7		/* ==========================================================================
8		    Menu
9		    ========================================================================== */
10		var logo_url = $('.main-logo img').attr('src');
11		$('.nav-logo').attr('src', logo_url);
12
13		$('.main-nav li.menu-item-has-children > a').append('<span class="toggle-submenu"></span>');
14
15		$('.btn-open-menu').click(function(event) {
16			event.preventDefault();
17			$('body').addClass('pb-open-menu');
18			$('.main-nav').fadeIn();
19		});
20
21		$('.btn-close-menu').click(function(event) {
22			event.preventDefault();
23			$('body').removeClass('pb-open-menu');
24			$('.main-nav').fadeOut();
25		});
26
27		$('.toggle-submenu').click(function(event) {
28			event.preventDefault();
29			$(this).closest('li').toggleClass('active');
30			$(this).parent().next('ul').slideToggle();
31		});
32		
33		/* ==========================================================================
34		    Scroll Popup
35		    ========================================================================== */
36		
37
38			const popup_scroll = $('.popup-scroll');
39			console.log(popup_scroll); 
40			
41
42
43
44		/* ==========================================================================
45		    Scroll
46		    ========================================================================== */
47		$(document).scroll(function() {
48			var scrollTop = $(this).scrollTop();
49			if(scrollTop > 100) {
50				$('.elementor-location-header').addClass('pb-fixed');
51			} else {
52				$('.elementor-location-header').removeClass('pb-fixed');
53			}
54		});
55
56		inView('.pb-scroll-class').on('enter', function(el) {
57			$(el).addClass('active');
58		}).on('exit', function(el) {
59			$(el).removeClass('active');
60		});
61
62		inView.offset(300);
63
64		/* ==========================================================================
65		    Read more
66		    ========================================================================== */
67		$('.pb-toggle-text a').click(function(event) {
68			event.preventDefault();
69			var _this = $(this),
70				id = _this.attr('href');
71			_this.toggleClass('active');
72			$(id).slideToggle();
73			if (_this.hasClass('active')) {
74				_this.text('Close');
75			} else {
76				_this.text('Read more');
77			}
78			return false;
79		});
80
81		/* ==========================================================================
82		    Slider
83		    ========================================================================== */
84		function mobileOnlySlider($slidername, $dots, $arrows, $slidesToShow, $slidesToScroll, $adaptiveHeight, $breakpoint) {
85			var slider = $($slidername);
86			var settings = {
87				mobileFirst: true,
88				dots: $dots,
89				arrows: $arrows,
90				slidesToShow: $slidesToShow,
91				slidesToScroll: $slidesToScroll,
92				adaptiveHeight: $adaptiveHeight,
93				responsive: [{
94					breakpoint: $breakpoint,
95					settings: "unslick"
96				}]
97			};
98
99			slider.slick(settings);
100
101			$(window).on("resize", function() {
102				if ($(window).width() > $breakpoint) {
103					return;
104				}
105				if (!slider.hasClass("slick-initialized")) {
106					return slider.slick(settings);
107				}
108			});
109		}
110
111		mobileOnlySlider(".why-us-slider", true, false, 1, 1, false, 767);
112
113		//stage 		
114		$(document).ready(function() {
115			let currentTabId = 'stage1';
116
117			function handleStageChange(tabId) {
118				if (currentTabId !== tabId) {
119					$('.details').fadeOut(200, function() {
120						$('#' + tabId).fadeIn();
121					});
122					currentTabId = tabId;
123				}
124			}
125
126			function initForLargeScreens() {
127				$('.details').hide();
128				$('#' + currentTabId).show();
129
130				$('.stage').removeClass('active');
131				$('.stage[data-tab="' + currentTabId + '"]').addClass('active');
132
133				$('.stage').off('click').on('click', function() {
134					$('.stage').removeClass('active');
135					$(this).addClass('active');
136
137					var tabId = $(this).attr('data-tab');
138					handleStageChange(tabId);
139				});
140			}
141
142			function initForSmallScreens() {
143				$('.details').hide();
144				$('#' + currentTabId).show();
145
146				var customSelect = $('.custom-select');
147				customSelect.find('.select-selected span').text(customSelect.find('.select-items div[data-value="' + currentTabId + '"]').text());
148
149				customSelect.off('click').on('click', function() {
150					$(this).find('.select-items').toggleClass('select-hide');
151				});
152
153				customSelect.find('.select-items div').off('click').on('click', function() {
154					var selectedText = $(this).text();
155					var selectedValue = $(this).attr('data-value');
156
157					customSelect.find('.select-selected span').text(selectedText);
158					customSelect.find('.select-items div').removeClass('same-as-selected');
159					$(this).addClass('same-as-selected');
160
161					handleStageChange(selectedValue);
162				});
163			}
164
165			function init() {
166				if ($(window).width() > 767) {
167					$('.stages-pc').show();
168					$('.stages-mb').hide();
169					initForLargeScreens();
170				} else {
171					$('.stages-pc').hide();
172					$('.stages-mb').show();
173					initForSmallScreens();
174				}
175			}
176
177			init();
178
179			$(window).resize(function() {
180				init();
181			});
182
183			$(document).click(function(e) {
184				if (!$(e.target).closest('.custom-select').length) {
185					$('.select-items').addClass('select-hide');
186				}
187			});
188		});
189
190
191
192		$(document).ready(function() {
193			$('.accordion-half p').addClass('acp');
194
195			$('.accordion-half .elementor-tab-content').each(function() {
196				if ($(this).find('p').length > 1) {
197					$(this).append('<div class="read-more">Read More</div>');
198				}
199			});
200
201			$(document).on('click', '.read-more', function() {
202				var acpElements = $(this).closest('.accordion-half').find('.acp');
203				if ($(this).text() === 'Read More') {
204					acpElements.css('display', 'block');
205					$(this).text('Close');
206				} else {
207					acpElements.css('display', 'none');
208					$(this).text('Read More');
209				}
210			});
211		});
212
213		   $(document).ready(function(){
214
215        var sectionOffset = $('.box-sticky .sticky-right').offset().top;
216        var rightHeight = $('.box-sticky .sticky-right').outerHeight();
217        var leftHeight = $('.box-sticky .sticky-left').outerHeight() + 50;
218        var margin = rightHeight - leftHeight + 50;
219        var removeFixedOffset = sectionOffset + rightHeight - leftHeight;
220
221        $(window).on('scroll', function() {
222
223          if ($(this).scrollTop() > sectionOffset) {
224            $('.box-sticky .sticky-left .elementor-widget').addClass('fixed');
225          } else {
226			  
227            $('.box-sticky .sticky-left .elementor-widget').removeClass('fixed');
228          }
229          if ($(this).scrollTop() > removeFixedOffset) {
230            $('.box-sticky .sticky-left .elementor-widget').addClass('fixed');
231          } else{
232            $('.box-sticky .sticky-left .elementor-widget').removeClass('fixed');
233			  
234          }
235
236        });
237
238      });
239
240	}); // end document ready
241})(jQuery); // end JQuery namespace

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.