PageSourceSearch

https://www.titipalacio.com/js/js_15/main.js?v=26

js titipalacio.com collected 2026-10-08 06:13:30 UTC 6,859 bytes, 217 lines download raw bytes

1var window_width;
2var content_opacity = 0;
3
4$(document).ready(function () {
5    BrowserDetect.init();
6
7    if (BrowserDetect.browser == 'Explorer' && BrowserDetect.version <= 9) {
8        $('body').html(better_browser);
9    }
10
11    window_width = $(window).width();
12});
13
14$(window).on('scroll', function () {
15    if (window_width > 992) {
16        template.checkScrollForParallax();
17    }
18
19    if (content_opacity == 1) {
20        template.checkScrollForContentTransitions();
21    }
22});
23
24$('a[data-scroll="true"]').click(function (e) {
25    var scroll_target = $(this).data('id');
26    var scroll_trigger = $(this).data('scroll');
27
28    if (scroll_trigger == true && scroll_target !== undefined) {
29        e.preventDefault();
30
31        $('html, body').animate({
32            scrollTop: $(scroll_target).offset().top - 50
33        }, 1000);
34    }
35});
36
37//start fancybox
38$(document).ready(function () {
39
40    //Ajax sending forms
41    //Documentation: http://api.jquery.com/jquery.ajax/
42    $("#callback").submit(function () {
43        $.ajax({
44            type: "GET",
45            url: "mail.php",
46            data: $("#callback").serialize()
47        }).done(function () {
48            alert("Thank you!");
49            setTimeout(function () {
50                $.fancybox.close();
51            }, 1000);
52        });
53        return false;
54    });
55});
56//end fancybox
57
58template = {
59    checkScrollForParallax: debounce(function () {
60        $('.parallax').each(function () {
61            var $elem = $(this);
62
63            if (isElementInViewport($elem)) {
64                var parent_top = $elem.offset().top;
65                var window_bottom = $(window).scrollTop();
66                var $image = $elem.children('.image');
67
68                oVal = ((window_bottom - parent_top) / 3);
69                $image.css('transform', 'translate3d(0px, ' + oVal + 'px, 0px)');
70            }
71        });
72
73    }, 6),
74
75    checkScrollForContentTransitions: debounce(function () {
76        $('.content-with-opacity').each(function () {
77            var $content = $(this);
78
79            if (isElementInViewport($content)) {
80                var window_top = $(window).scrollTop();
81                opacityVal = 1 - (window_top / 230);
82
83                if (opacityVal < 0) {
84                    opacityVal = 0;
85                    return null;
86                } else {
87                    $content.css('opacity', opacityVal);
88                }
89
90            }
91        });
92    }, 6),
93};
94
95// Returns a function, that, as long as it continues to be invoked, will not
96// be triggered. The function will be called after it stops being called for
97// N milliseconds. If `immediate` is passed, trigger the function on the
98// leading edge, instead of the trailing.
99
100function debounce(func, wait, immediate) {
101    var timeout;
102    return function () {
103        var context = this,
104            args = arguments;
105        clearTimeout(timeout);
106        timeout = setTimeout(function () {
107            timeout = null;
108            if (!immediate) func.apply(context, args);
109        }, wait);
110        if (immediate && !timeout) func.apply(context, args);
111    };
112}
113
114
115function isElementInViewport(elem) {
116    var $elem = $(elem);
117
118    // Get the scroll position of the page.
119    var scrollElem = ((navigator.userAgent.toLowerCase().indexOf('webkit') != -1) ? 'body' : 'html');
120    var viewportTop = $(scrollElem).scrollTop();
121    var viewportBottom = viewportTop + $(window).height();
122
123    // Get the position of the element on the page.
124    var elemTop = Math.round($elem.offset().top);
125    var elemBottom = elemTop + $elem.height();
126
127    return ((elemTop < viewportBottom) && (elemBottom > viewportTop));
128}
129
130var BrowserDetect = {
131    init: function () {
132        this.browser = this.searchString(this.dataBrowser) || "Other";
133        this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown";
134    },
135    searchString: function (data) {
136        for (var i = 0; i < data.length; i++) {
137            var dataString = data[i].string;
138            this.versionSearchString = data[i].subString;
139
140            if (dataString.indexOf(data[i].subString) !== -1) {
141                return data[i].identity;
142            }
143        }
144    },
145    searchVersion: function (dataString) {
146        var index = dataString.indexOf(this.versionSearchString);
147        if (index === -1) {
148            return;
149        }
150
151        var rv = dataString.indexOf("rv:");
152        if (this.versionSearchString === "Trident" && rv !== -1) {
153            return parseFloat(dataString.substring(rv + 3));
154        } else {
155            return parseFloat(dataString.substring(index + this.versionSearchString.length + 1));
156        }
157    },
158
159    dataBrowser: [{
160            string: navigator.userAgent,
161            subString: "Chrome",
162            identity: "Chrome"
163        },
164        {
165            string: navigator.userAgent,
166            subString: "MSIE",
167            identity: "Explorer"
168        },
169        {
170            string: navigator.userAgent,
171            subString: "Trident",
172            identity: "Explorer"
173        },
174        {
175            string: navigator.userAgent,
176            subString: "Firefox",
177            identity: "Firefox"
178        },
179        {
180            string: navigator.userAgent,
181            subString: "Safari",
182            identity: "Safari"
183        },
184        {
185            string: navigator.userAgent,
186            subString: "Opera",
187            identity: "Opera"
188        }
189    ]
190};
191
192var better_browser = '<div class="container"><div class="better-browser row"><div class="col-md-2"></div><div class="col-md-8"><h3>We are sorry but it looks like your Browser doesn\'t support our website Features. In order to get the full experience please download a new version of your favourite browser.</h3></div><div class="col-md-2"></div><br><div class="col-md-4"><a href="https://www.mozilla.org/ro/firefox/new/" class="btn btn-warning">Mozilla</a><br></div><div class="col-md-4"><a href="https://www.google.com/chrome/browser/desktop/index.html" class="btn ">Chrome</a><br></div><div class="col-md-4"><a href="http://windows.microsoft.com/en-us/internet-explorer/ie-11-worldwide-languages" class="btn">Internet Explorer</a><br></div><br><br><h4>Thank you!</h4></div></div>';
193
194/*!
195 * Simple jQuery Equal Heights
196 *
197 * Copyright (c) 2013 Matt Banks
198 * Dual licensed under the MIT and GPL licenses.
199 * Uses the same license as jQuery, see:
200 * http://docs.jquery.com/License
201 *
202 * @version 1.5.1
203 */
204! function (a) {
205    a.fn.equalHeights = function () {
206        var b = 0,
207            c = a(this);
208        return c.each(function () {
209            var c = a(this).innerHeight();
210            c > b && (b = c)
211        }), c.css("height", b)
212    }, a("[data-equal]").each(function () {
213        var b = a(this),
214            c = b.data("equal");
215        b.find(c).equalHeights()
216    })
217}(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.