Change the image link dynamically in responsive mode


Staff member
how to change the images link dynamically in responsive mode.
i am working on the wordpress and showing the thumbnails having fixed size <strong>280*200</strong> but in the resolution between <strong>480px to 600px</strong> i am wanted to change the thumbnail size to medium(which i have set to <strong>480*200</strong>) how i can achieve this?
any script to detect the device resolution and change the img src automatically to medium size thumbnails???
like this

<strong>(in desktop versions)</strong>

&lt;img class="attachment-thumb-small wp-post-image" src="280x200.jpg"&gt;

<strong>(in mobile versions)</strong>

&lt;img  class="attachment-thumb-medium wp-post-image" src="480x200.jpg"&gt;