Created
November 27, 2015 02:12
-
-
Save gavingmiller/9f2a3b3b6363cb51f631 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img id="preview" style="display: none; max-width: 200px" src=""> | |
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> | |
<script> | |
$(document).ready(function() { | |
$("#photo_url").on("blur", function(event) { | |
var photo_url = $(this).val(); | |
var preview = $("#preview"); | |
if (photo_url) { | |
preview.attr("src", photo_url) | |
preview.show(); | |
} else { | |
preview.hide(); | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment