Skip to content

Instantly share code, notes, and snippets.

View Sysetup's full-sized avatar
🚀

Carlos H. Ramírez. Sysetup

🚀
View GitHub Profile
@Sysetup
Sysetup / FanciesJQueryCallbacks.js
Created July 19, 2016 23:27
Fancies JQuery callbacks.
//http://www.etnassoft.com/2011/03/29/reorganizando-los-callbacks-en-jquery/
// We write all callbacks in the same object
var callbacks = {
myFunctionOne: function( event ) {
// Do something...
},
myFunctionTwo: function( event ) {
// Do something...
@Sysetup
Sysetup / LoadingMultipleScripts.js
Created July 19, 2016 23:26
Loading multiple scripts with $.getScript
$('.main-content').load('includes/home.html',function(){
$.when(
$.getScript("assets/plugins/parallax-slider/js/modernizr.js"),
$.getScript("assets/plugins/parallax-slider/js/jquery.cslider.js"),
$.getScript("assets/js/plugins/parallax-slider.js"),
$.Deferred(function( deferred ){
$( deferred.resolve );
})
).done(function(){
App.init();
@Sysetup
Sysetup / load()fadeInOutJQuery.js
Created July 19, 2016 23:24
.load() fade in/out JQuery
//http://stackoverflow.com/questions/9337220/jquery-load-with-fadein-effect
$('#primary').fadeOut('slow', function(){
$('#primary').load(link+' #content', function(){
$('#primary').fadeIn('slow');
});
});
@Sysetup
Sysetup / PreventJQueryAnimationQueue.js
Created July 19, 2016 23:23
Prevent JQuery Animation Queue
//stop() is the key.
$( "#hoverme-stop-2" ).hover(function() {
$( this ).find( "img" ).stop( true, true ).fadeOut();
}, function() {
$( this ).find( "img" ).stop( true, true ).fadeIn();
});
//Other example:
$(document).ready(function() {
@Sysetup
Sysetup / BootstrapFixedBottomFooter.html
Created July 19, 2016 23:21
Bootstrap fixed bottom footer
<footer class="navbar navbar-fixed-bottom">
<p>&copy; SySetUp 2016</p>
</footer>
@Sysetup
Sysetup / LoadAjaxHistoryBrowse.js
Created July 19, 2016 23:19
Load Ajax history browse
$('#pageslide .v-item, #menu-main a, #menu-main-1 a, #menu-secondary a').on('click', function () {
location.hash = $(this).attr('href').match(/(^.*)\./)[1];
return false
})
var originalTitle = document.title
function hashChange() {
var page = location.hash.slice(1);
if (page != "") {
$('#showHere').load(page + '.html');