PageSourceSearch

https://www.carltonhotelblanchardstown.com/files/js/settings.min.js

js carltonhotelblanchardstown.com collected 2026-10-02 20:45:11 UTC 10,180 bytes, 334 lines download raw bytes

1//SMOOTHSCROLL
2$(function () {
3    $("a[href*=#]:not([href=#])").click(function () {
4        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
5            var target = $(this.hash);
6            target = target.length ? target : $("[name=' + this.hash.slice(1) +']");
7            if (target.length) {
8                $('html,body').animate({
9                    scrollTop: target.offset().top - 74
10                }, 1000, 'easeInOutCubic');
11                return false;
12            }
13        }
14    });
15});
16
17// CONVERTING IMG SVG TO INLINE SVG
18// Easy to manipulate with class
19// To use just add class="svg" to your image
20$('img.svg').each(function () {
21    var $img = $(this);
22    var imgID = $img.attr('id');
23    var imgClass = $img.attr('class');
24    var imgURL = $img.attr('src');
25    $.get(imgURL, function (data) {
26        // Get the SVG tag, ignore the rest
27        var $svg = $(data).find('svg');
28        // Add replaced image's ID to the new SVG
29        if (typeof imgID !== 'undefined') {
30            $svg = $svg.attr('id', imgID);
31        }
32        // Add replaced image's classes to the new SVG
33        if (typeof imgClass !== 'undefined') {
34            $svg = $svg.attr('class', imgClass + ' replaced-svg');
35        }
36        // Remove any invalid XML tags
37        $svg = $svg.removeAttr('xmlns:a');
38        // Replace image with new SVG
39        $img.replaceWith($svg);
40    }, 'xml');
41});
42
43// IMAGE LAZYLOAD
44$('.lazy-img').each(function () {
45    var $img = $(this);
46    var imgURL = $img.attr('src');
47
48    if (imgURL) {
49        $($img).attr('data-src', imgURL);
50        $($img).removeAttr('src');
51        $($img).attr('src', 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==');
52    }
53
54});
55var bLazy = new Blazy({
56    selector: 'img.lazy-img',
57    offset: 300,
58    successClass: 'lazy-loaded',
59});
60
61
62// OBJECT FIT CALL
63$(function () {
64    objectFitImages();
65});
66
67//FORMS ICONS
68
69$('form').each(function () {
70    var select = $(this).find('select:not([multiple=multiple])');
71    var datepicker = $(this).find('.datepicker');
72
73    // select.each(function () {
74    select.parent().addClass('select-icon');
75    datepicker.parent().addClass('datepicker-icon');
76    // }
77
78});
79
80
81function mobileView() {
82    return $(window).outerWidth() < 768;
83}
84
85function tabletView() {
86    return $(window).outerWidth() < 1279;
87}
88
89function videoResizer() {
90    $('.js-resize').each(function () {
91        var $videoContainer = $('.js-resize');
92        var $video = $('.js-resize').find('video');
93
94        var videoHeight = parseInt($video.attr('height'));
95        var videoWidth = parseInt($video.attr('width'));
96
97        var videoHolderHeight = parseInt($videoContainer.outerHeight());
98        var videoHolderWidth = parseInt($videoContainer.outerWidth());
99
100        if (videoHeight / videoWidth > videoHolderHeight / videoHolderWidth) {
101            $video.css('width', videoHolderWidth);
102            $video.css('height', videoHeight * (videoHolderWidth / videoWidth));
103        } else {
104            $video.css('height', videoHolderHeight);
105            $video.css('width', videoWidth * (videoHolderHeight / videoHeight));
106        }
107    });
108}
109
110function initSliders() {
111    $('.slider-offers').each(function () {
112        var $slider = $(this);
113        var $sliderSlides = $slider.find('.slider__slides');
114        var $sliderArrows = $slider.find('.slider__arrows');
115        var $sliderDots = $slider.find('.slider__dots');
116
117        $sliderSlides.slick({
118            arrows: true,
119            dots: true,
120            appendArrows: $sliderArrows,
121            appendDots: $sliderDots,
122            slidesToShow: 1,
123            slidesToScroll: 1,
124            speed: 1000
125        });
126    });
127}
128
129$('.nav__menu > ul > li').each(function () {
130    if ($(this).find("ul").length) {
131        $(this).addClass("dropdown");
132        $('.nav__menu > ul > li > ul').addClass("dropdown-items");
133        $(this).prepend("<span><i class='mdi-chevron-down'></i></span>");
134    }
135});
136$('.dropdown > span').on('click', function (event) {
137    $(this)
138        .closest('.dropdown')
139        .toggleClass('expanded')
140        .find('.dropdown-items')
141        .slideToggle()
142        .end()
143        .siblings()
144        .removeClass('expanded')
145        .find('.dropdown-items')
146        .slideUp()
147})
148
149function clickHandlers() {
150    // Button Menu
151    $('.button-menu').on('click', function (e) {
152        e.preventDefault();
153
154        $(this)
155            .add($('.header'))
156            .toggleClass('active');
157    });
158
159    // Intro Scroll 
160    $('.js-scroll').on('click', function (e) {
161        e.preventDefault();
162
163        $('html, body').animate({
164            scrollTop: $('.intro').outerHeight()
165        }, 1400);
166    });
167    // Dropdowns
168    $('.dropdown-container > a').on('click', function (e) {
169        e.preventDefault();
170
171        $(this).next().stop().slideToggle()
172            .parent().toggleClass('dd-show')
173            .siblings().removeClass('dd-show')
174            .find('.dropdown-menu').slideUp()
175
176    });
177}
178
179$(document).ready(function () {
180    initSliders();
181    clickHandlers();
182
183
184    if ($(window).width() < 1280) {
185        $('.section__aside .slider-images .slider__clip').trigger('sticky_kit:detach');
186    } else {
187        if ($('.section__aside .slider-images .slider__clip').height() < $('.section__aside').height()) {
188            $('.section__aside .slider-images .slider__clip').stick_in_parent({
189                offset_top: 80
190            });
191        } else {
192            $('.section__aside .slider-images .slider__clip').trigger('sticky_kit:detach');
193        }
194    }
195
196
197});
198
199$(document).on('click', function (e) {
200    var $target = $(e.target);
201
202    if (!$target.closest('.btn-menu, .header').length) {
203        $('.btn-menu')
204            .add($('.header'))
205            .removeClass('active');
206    }
207});
208
209$(window).on('load', function () {
210    // Dropdowns
211    $('.dropdown-menu').css('display', 'none');
212    $('.dropdown-container').removeClass('dd-show');
213});
214
215$(window).on('load resize orientationchange', function () {
216    videoResizer();
217
218
219    $('.intro__banner-img').slick({
220        infinite: true,
221        arrows: true,
222        buttons: false,
223        dots: false,
224        slidesToShow: 1,
225        slidesToScroll: 1,
226        swipeToSlide: true,
227        draggable: true,
228        autoplay: true,
229        autoplaySpeed: 3000,
230    });
231
232    if ($('.slider-nav-pages .slider__clip > ul li').length > 0) {
233        $('.slider-nav-pages .slider__clip > ul').addClass('slider__slides');
234    }
235
236    // Initialize and destroy Sliders
237
238    if (($(window).outerWidth() < 1024)) {
239
240        if ($('.slider-nav-pages').length && !$('.slider-nav-pages .slider__slides').hasClass('slick-initialized')) {
241
242            $('.slider-nav-pages .slider__slides').slick({
243                variableWidth: true,
244                infinite: false,
245                arrows: true,
246                buttons: false,
247                dots: false,
248                slidesToShow: 1,
249                slidesToScroll: 1,
250                swipeToSlide: true,
251                draggable: true,
252            });
253
254            var activeSlide = $('.slider-nav-pages').find('.active-page').closest('.slick-slide').attr('data-slick-index');
255            $('.slider-nav-pages .slider__slides').slick('slickGoTo', activeSlide);
256
257            $('.slider-nav-pages .slider__clip').css('visibility', 'visible');
258        }
259    }
260
261    if (($(window).outerWidth() > 1023)) {
262
263        $('.slider-nav-pages .slider__slides').slick({
264            variableWidth: false,
265            infinite: true,
266            arrows: true,
267            buttons: false,
268            dots: false,
269            slidesToShow: 4,
270            slidesToScroll: 1,
271            swipeToSlide: true,
272            draggable: true,
273        });
274
275        var activeSlide = $('.slider-nav-pages').find('.active-page').closest('.slick-slide').attr('data-slick-index');
276        $('.slider-nav-pages .slider__slides').slick('slickGoTo', activeSlide);
277
278        if ($('.slider-nav-pages .slider__slides li').length <= 4) {
279            $('.slider-nav-pages .slider__slides').slick('unslick');
280        }
281        $('.slider-nav-pages .slider__clip').css('visibility', 'visible');
282    }
283
284    if (($(window).outerWidth() < 768)) {
285        if ($('.slider-images').length && !$('.slider-images .slider__slides').hasClass('slick-initialized')) {
286
287            $('.slider-images').each(function () {
288                var $slider = $(this);
289                var $sliderSlides = $slider.find('.slider__slides');
290                var $sliderArrows = $slider.find('.slider__arrows');
291                var $sliderDots = $slider.find('.slider__dots');
292
293                $sliderSlides.slick({
294                    infinite: true,
295                    arrows: true,
296                    appendArrows: $sliderArrows,
297                    dots: false,
298                    slidesToShow: 1,
299                    slidesToScroll: 1,
300                    swipeToSlide: true,
301                    draggable: true,
302                });
303            });
304        }
305    }
306
307    if (($(window).outerWidth() > 767)) {
308        if ($('.slider-images').length && $('.slider-images .slider__slides').hasClass('slick-initialized')) {
309            $('.slider-images .slider__slides').slick('unslick');
310        }
311    }
312});
313
314$(window).scroll(function () {
315    if ($(this).scrollTop() > 50) {
316        $('.header--home').addClass('header--inside');
317    } else {
318        $('.header--home').removeClass('header--inside');
319    }
320});
321
322$(document).ready(function() {
323    $(".gallery--page").fancybox({
324      arrows : true,
325      openEffect  : 'fade',
326      closeEffect : 'fade'
327  });
328
329if ($('.section__entry table').length) {
330  $('.section__entry table').wrap('<div class="table-wrap"></div>');
331  $('.table-wrap').css('overflow-x', 'auto')
332}
333
334});

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.