Wanted: the coding answer to our problem.
We use svg spritesheet-one for our desktop site. The icon is delivered this way:
<div id="desktop"><svg class="icon-class"><use xlink:href="/sprites/spritesheet-one#icon-one"></use></svg></div>
<div id="mobile"><svg class="icon-class"><use xlink:href="/sprites/spritesheet-two#icon-one"></use></svg></div>
We don't need spritesheet-one for our mobile site, instead we will use "spritesheet-two".
How do we prevent spritesheet-one from loading at all for mobile?
Please respond with the price you need to provide the answer today.
Thank you.
You could use JavaScript to load either the desktop or mobile spritesheet (probably based on screen width).
For a complete solution, you probably want to detect changes in screen width and possibly load the other spritesheet when it happens - e.g., if an iPad user switches device orientation from portrait to landscape, you may want to switch from mobile to desktop layout.
Let me know if you are interested in this approach. Thanks for considering my bid.
$50 USD en 3 días
5,0 (19 comentarios)
4,5
4,5
14 freelancers están ofertando un promedio de $138 USD por este trabajo
I have good work experience with front end technologies.
Solution to your problem will be (in a broad way):
1. Check if mobile
2. Use the respective spritesheet