Created
November 18, 2016 10:04
-
-
Save jhouedanou/b61a4601f298c89cd6a91da828acb824 to your computer and use it in GitHub Desktop.
responsive thickbox
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 ($) { | |
$(window).resize(function() { | |
var newHeight = $(window).height(); | |
// console.log(newHeight); | |
var newWidth = $(window).width(); | |
// console.log(newWidth); | |
$("#TB_window").css("height", (newHeight)); | |
$("#TB_window").css("width", (newWidth)); | |
$('#TB_ajaxContent').css("width", (newWidth)); | |
$("#TB_window").css("margin-left", -(parseInt((newWidth)/2))); | |
// $("#TB_window").css("margin-left", (-newWidth)/2); | |
}); | |
/* trigger when page is ready */ | |
$(window).load(function() { | |
var newHeight = $(window).height(); | |
// console.log(newHeight); | |
var newWidth = $(window).width(); | |
// console.log(newWidth); | |
$("#TB_window").css("height", (newHeight)); | |
$("#TB_window").css("width", (newWidth)); | |
$('#TB_ajaxContent').css("width", (newWidth)); | |
$("#TB_window").css("margin-left", -(parseInt((newWidth)/2))); | |
}); | |
}(window.jQuery || window.$)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment