This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var defaults = { | |
| radius: 25, | |
| defaultradius: 0, | |
| enableTilt: true, | |
| tilt: 20, | |
| random: true, | |
| randomMax: 25, | |
| colors: ['4AC7ED', 'FDC015', '9F78EC', 'F25C33'] | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function () { | |
| var locationHashObjTop = false; | |
| $('input[type="submit"]').on('click', function () { | |
| var $locationHashObj = $(this).prev(); | |
| var locationHash = '#' + $(this).prev().attr('id'); | |
| locationHashObjTop = $locationHashObj.offset().top; | |
| sessionStorage.setItem('fileHash', locationHash); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * get URL parameter | |
| */ | |
| function GetURLParameter(sParam) { | |
| var sPageURL = window.location.search.substring(1); | |
| var sURLVariables = sPageURL.split('&'); | |
| for (var i = 0; i < sURLVariables.length; i++) { | |
| var sParameterName = sURLVariables[i].split('='); | |
| if (sParameterName[0] == sParam) { | |
| return sParameterName[1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Check if plugin is ready to call | |
| function checkVendor(vendor, selector, options) { | |
| if (!jQuery()[vendor]) { | |
| console.log('ERROR: obsadź plugin: ' + vendor); | |
| } else { | |
| $(selector)[vendor](options); | |
| } | |
| } | |
| // Example use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function () { | |
| $('_btnBrowse').click(function (e) { | |
| e.preventDefault(); | |
| $('#inputUpload').click(); | |
| }); | |
| $('#inputUpload').change(function () { | |
| var filename = $('input[type=file]').val().split('\\').pop(); | |
| var setContent = $('.inputFile').html(filename); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| location = { | |
| host: "stackoverflow.com", | |
| hostname: "stackoverflow.com", | |
| href: "http://stackoverflow.com/questions/2300771/jquery-domain-get-url", | |
| pathname: "/questions/2300771/jquery-domain-get-url", | |
| port: "", | |
| protocol: "http:" | |
| } | |
| location.host // would be the domain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // jak przygotowac metode: http://jsfiddle.net/rafx/rtmtkqto/ | |
| // http://stackoverflow.com/questions/3502468/unbind-remove-kill-a-jquery-plugin | |
| // przyklad na pluginie Stellar: | |
| // http://stackoverflow.com/questions/12236631/can-stellar-js-readjust-element-offsets-on-window-resize | |
| $(window).data('plugin_stellar').destroy(); | |
| $(window).data('plugin_stellar').init(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Uniwersal hider | |
| // ============================================================ | |
| function hider(targetToHide, trigger) { | |
| $(document).on('mouseup', function (e) { | |
| if (!targetToHide.is(e.target) // if the target of the click isn't the container... | |
| && targetToHide.has(e.target).length === 0 // ... nor a descendant of the container | |
| && !trigger.is(e.target)) // ... nor a trigger of the container | |
| { | |
| console.log(targetToHide); | |
| targetToHide.add(trigger).removeClass('active'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function loadScript(url, callback) { | |
| var head = document.getElementsByTagName('head')[0]; | |
| var script = document.createElement('script'); | |
| script.type = 'text/javascript'; | |
| script.src = url; | |
| // Then bind the event to the callback function. | |
| // There are several events for cross browser compatibility. | |
| script.onreadystatechange = callback; | |
| script.onload = callback; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var keys = {}; | |
| $(document).keydown(function (e) { | |
| keys[e.which] = true; | |
| showThemeSelector(e); | |
| }); | |
| $(document).keyup(function (e) { | |
| delete keys[e.which]; |
OlderNewer