Hi I currently have a aspx user control that pulls an image from umbraco and displays it as a inline background image overriding the default image that Is set in the css file.
It will display the default css image when an image has not been selected in umbraco.
I am trying to set it up so that when a screen size hits a certain breakpoint a different image displays from one selected In umbraco.
Here is the code used to display the image, along with the html code.
Is there anyway I could do an IF Statement on this line of code, something along the lines of
Use different image for mobile displays
Hi I currently have a aspx user control that pulls an image from umbraco and displays it as a inline background image overriding the default image that Is set in the css file.
It will display the default css image when an image has not been selected in umbraco.
I am trying to set it up so that when a screen size hits a certain breakpoint a different image displays from one selected In umbraco.
Here is the code used to display the image, along with the html code. Is there anyway I could do an IF Statement on this line of code, something along the lines of
I just am unable to figure out how to get the current screen size(media query) at the user control level.
Any help or guidance would be much appreciated!
// CODE
Hi Ian,
Try to use Slimsy package for responsive images with Umbraco - https://our.umbraco.org/projects/website-utilities/slimsy/
You need just render images as usual and add slimsy js library. By the way you can't control browser window from the uservontrol code, it's js task.
Thanks,
Alex
is working on a reply...