I've managed to get my matchmedia query partially working ie it works on window load but can't get to work on resize. Im really new to this (hence the crappy question) so take it easy and speak slow. I'm trying to make it fire when ever the screen changes or the page is loaded.
http://codepen.io/anon/pen/XJZOMw
function mediaqueryresponse(screencheck){
if (screencheck.matches){
function introHeight(){
var introheight = document.getElementById("bottom").offsetHeight;
document.getElementById("introtext").style.top =(180 - introheight) + "px";
//document.write (introheight);
}
//document.onresize = introHeight;
window.onresize = introHeight;
}
}
var screencheck = window.matchMedia("all and (max-width: 419px)");
mediaqueryresponse(screencheck); // call listener function explicitly at run time
screencheck.addListener(mediaqueryresponse); // attach listener function to listen in on state changes
Thanks and Sorry if this a duplicate or just crap programming and/or poorly written or in the wrong place.