Replacing SVG block with js

I have two SVG image files. Other is supposed to use on desktop sizes and another on mobile sizes. But how can I change between the files? I can't use just simply img tag because I have link inside svg. Current implemention is following..

In my template:

<?php include("img/content/myimage_mobile.svg"); ?>

Now this works perfectly fine on mobile. The link etc. works nicely. But when come to desktop size, how can I change that file to myimage.svg? With JS somehow?

Thanks!

Answers


Haha, sorry for this. This actually was stupid. Of course I just wrap those SVGs into two divs and then with CSS & media queries show those divs on right moments :D


Need Your Help

How to over come from Database Locked Exception?

android sqlite

I am implementing an app where I make database calls frequently.

Error install hhvm with macport and fail all install with macport

macos python-2.7 port macports hhvm

I tried to install HHVM on Mac OS X Yosemite, but it failed and at last I can not make any installation MacPort.