vishal vishal - 4 months ago 15
Javascript Question

Change height and width of image using url of the external website using jquery

i have url in my image source
like this
i get this value in array for eg. img[0].so is it possible to change it with php or jquery

http://feedtest.tecontent.com/image.php/cover.jpg?image=/covers/cover.jpg&width=400&height=571&quality=90


i want change its height and width using JQuery when they load is it possible using jquery

Answer

you can do some thing like this if remote site accept new width and display image as per your needs

img[0] = preg_replace( array('/width=[0-9][0-9][0-9]/i', '/height=[0-9][0-9][0-9]/i'), array('width=200','height=200'), $content);
Comments