I am busy setting up a new forum layout and I wanted to use the following css for the thread view in forum display:
and I am setting the background image as a style in forumdisplay_thread where the background image is the uploaded coverpic
but I have a responsive site. I did not really want to use the full size image on the mobile and tablet variants as it will delay page loading.
What I thought of doing was getting the viewport width via javascript and setting that as a variable for a template conditional and loading the resized mages (generated via an XThreads custom field) but I am unsure how to do that. I found this js snippet for getting viewport width
but I am unsure how to get that into a "setvar". Please can anyone help?