I am trying to execute things on window.resize
, but I can't even get alert to work more than once. All of the code I have is this:
HTML:
<head>
<meta charset="utf-8">
<script src="jquery-1.11.1.min.js"></script>//I have this library in this html's file directory
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
window.resize(alert("yolo"));
});
</script>
</head>
<body>
...
</body>
I have also tried several variations:
window.resize(...)
window.on("resize",...)
window.one("resize",...)
$(window).resize(...)
$(window).on("resize",...)
$(window).one("resize",...)
None of them work. Is there anything else I haven't tried?