Created
October 17, 2017 08:02
-
-
Save thierrypigot/3f01845a244502a34a77f892cddb032f to your computer and use it in GitHub Desktop.
jQuery move bloc when you resize the window.
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
// Example here: www.sesame-consultants.com/nos-services/etudes-et-investigations/ | |
(function($) { | |
"use strict"; | |
function wearewp_resize(){ | |
var cta = $('.container-cta'); | |
if( window.matchMedia("(max-width: 991px)").matches ) { | |
$('.service').after( cta ); | |
}else{ | |
$('.before-cta').after( cta ) | |
} | |
} | |
$(window).resize(function(){ | |
wearewp_resize(); | |
}); | |
$(document).ready(function() { | |
wearewp_resize(); | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment