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 / 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');
@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 / 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 / Vertical<div>center.js
Created July 19, 2016 23:27
Vertical <div> center
jQuery(document).ready(function() {
App.init();
PageComingSoon.initPageComingSoon();
$('body').css('margin-top', Number($(document).height() - $('.coming-soon-v3').height())/2);
$(window).resize(function() {
$('body').css('margin-top', Number($(document).height() - $('.coming-soon-v3').height())/2);
});
});
@Sysetup
Sysetup / BeforeCloseBrowserWindow.js
Last active July 19, 2016 23:30
Before close browser window JavaScript
$(window).on('beforeunload', function (){
//code...
return false;
})
@Sysetup
Sysetup / GoogleMap.js
Created August 28, 2016 22:00
Simple embed Google Map example.
/*
Steps:
1. Go to: http://map.google.com
2. Pin whatever point in the map.
3. Menu/Share or embed map.
*/
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3977.2854808824613!2d-75.66567468522176!3d4.5425483442734!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x8e38f4ff13a056e9%3A0x78c9afbeed619948!2sSYSETUP!5e0!3m2!1sen!2sco!4v1472421311744" width="2200" height="300" frameborder="0" style="border:0" allowfullscreen>
</iframe>
@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 / 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 / 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 / GoogleMap.js
Last active August 28, 2016 22:12
Simple Google Map.
(function initMap() {
var contentString = '<div id="content">'+
'<div id="bodyContent">'+
'<p><h3>Sysetup.com</h3>' +
'<address class="md-margin-bottom-40">'+
'<i class="fa fa-phone"></i> <a href="tel:+573116417210">COL: (+57) 311 641 7210 </a> <br>'+
'<i class="fa fa-phone"></i> <a href="tel:+573209004589">COL: (+57) 320 900 4589 </a> <br>'+
'<i class="fa fa-home"></i> Cll 2 14-02, 630004 Armenia Q. Colombia. <br>'+
'<i class="fa fa-envelope"></i> <a href="mailto:contact@sysetup.com">contact@sysetup.com</a>'+
'</address>'+