38 lines
946 B
HTML
38 lines
946 B
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Images</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="description" content="">
|
|
<style>
|
|
#files img {cursor: pointer; margin:20px; height:150px}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="files">
|
|
<img src="uploads/red.jpg" />
|
|
<img src="uploads/book.jpg" />
|
|
<img src="uploads/flower.jpg" />
|
|
</div>
|
|
|
|
<script>
|
|
var images = document.querySelectorAll('#files img');
|
|
[].forEach.call(images, function(img) {
|
|
|
|
var imgurl = img.getAttribute('src');
|
|
img.addEventListener('click', () => {
|
|
|
|
/*
|
|
USE THIS FUNCTION TO SELECT CUSTOM ASSET WITH CUSTOM VALUE TO RETURN
|
|
An asset can be a file, an image or a page in your own CMS
|
|
*/
|
|
parent.selectImage(imgurl);
|
|
|
|
});
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |