Created
November 1, 2017 02:43
-
-
Save dospuntocero/4100afe307facb845a8191a391a7d00f to your computer and use it in GitHub Desktop.
use jquery to test for changed css property and make responsive changes. instead of checking on browser width
This file contains hidden or 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
//The CSS | |
.tocheck {float:left;} | |
@media only screen and (max-width: 800px){ | |
.tocheck {float:none;} | |
} |
This file contains hidden or 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
//The jQuery | |
$(document).ready(function() { | |
// run test on initial page load | |
checkSize(); | |
// run test on resize of the window | |
$(window).resize(checkSize); | |
}); | |
//Function to the css rule | |
function checkSize(){ | |
if ($(".tocheck").css("float") == "none" ){ | |
// your code here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment