Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swapping an image during web development

I'm trying to see what a certain webpage would look like if I replaced a certain image with another. Rather than upload the image, edit the site, etc, each time I tweak it, I'd like to know if there's a way to change the image in the page to my local version while viewing the remote page.

I use Firebug for debugging web development usually, but I'm open to any other tool that might do this.

(It is absolutely impossible to search for this and find anything but questions about dynamic image swapping on a deployed website, so sorry if this is a duplicate.)

Added: I just tried substituting a file:/// URI pointing to the image (copied and pasted from the address bar after manually opening the image), and alas, it did not work — the image fails to change.

like image 322
detly Avatar asked Jun 02 '10 02:06

detly


People also ask

How do I swap an image in HTML?

Image swapping is accomplished by setting the src property of the visible img element to the src property of the desired memory image. Notice how string values used as index values for both the preloaded and document.

What is image swapping?

Swap Images is basically a Javascript effect similar to the rollover effect where a group of web objects [web object - a slice, hotspot, or button] trigger the change in the display of (swaps) another graphic when you mouse over them and may or may not revert back to the original image on mouse out of the web object.

How can I swap two images in Javascript?

Hello guys, in this post we will explore how to find the solution to How To Swap Two Images In Javascript in programming. <img src="ble. jpg" id="F" data-value="" onclick="swap(5)" /> <img src="ilk. jpg" id="4" data-value="2" onclick="swap(6)"/> var img_1_value = document.


1 Answers

It seems to only work with the http[s] protocols (likely for security reasons). You can store your images on service like Dropbox, share the image or folder, then use the public URLs.

Really, you can use any web accessible images, so a local server would work too.

like image 83
Ryan Emerle Avatar answered Oct 16 '22 21:10

Ryan Emerle