Last active
December 14, 2015 19:32
-
-
Save joaomosantos/5a048f06d53978816268 to your computer and use it in GitHub Desktop.
Javascript
This file contains 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 setDimensions(){ | |
var windowsWidth = $(window).width(); | |
$('.content img').css('width', windowsWidth + 'px'); | |
} | |
$(document).ready(function() { | |
setDimensions(); | |
}); | |
$(window).resize(function() { | |
setDimensions(); | |
}); |
This file contains 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 paths = [ | |
'internacional/seguros-gratuitos-mastercard.', | |
'gold/seguros-gratuitos-mastercard.', | |
'gold/masterassist.' | |
]; | |
var pathname = window.location.pathname; | |
for (var i = 0; i < paths.length; i++) { | |
var path = paths[i]; | |
var regex = new RegExp(path); | |
if (regex.test(window.location.href)) { | |
$.magnificPopup.open({ | |
items: { | |
src: '#magnific-popup' | |
}, type: 'inline' | |
}, 0); | |
} | |
} |
This file contains 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
$(document).ready(function() { | |
$(window).scroll(function() { | |
if ($(this).scrollTop() > 100) { | |
$('.icon-scroll').fadeIn(); | |
} else { | |
$('.icon-scroll').fadeOut(); | |
} | |
}); | |
$('.icon-scroll').click(function(){ | |
$('html, body').animate({scrollTop : 0 }, 800); | |
return false; | |
}); | |
}); |
This file contains 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
//Javascript | |
$(document).ready(function() { | |
$(window).scroll(function() { | |
$('.bar-content').toggleClass('is-fixed', $(this).scrollTop() > 200); | |
}); | |
}); | |
//CSS | |
.bar-content { | |
position:relative; | |
top: 0; | |
} | |
.is-fixed { | |
position: fixed; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment