Everything posted by squeezeeur
-
Store image and users email in an array and print to screen?
let selected_images = []; document.querySelectorAll('.large-image').forEach(function(img, idx) { img.src = "" + idx; img.addEventListener('click', function({target: src}){ if(!selected_images.includes(src)) { selected_images.push(src); } //document.getElementById('preview').appendChild(selected_images[0]); console.log(selected_images); }); }); The code above is my code so far. Moreover, the code executes in the console as normal, but when the array image outputs to HTML it replaces the original image. //POPUP const images = [...document.querySelectorAll('.image')]; const popup = document.querySelector('.popup'); const closeBtn = document.querySelector('.close-btn'); const largeImage = document.querySelector('.large-image'); images.forEach((item, i) => { item.addEventListener('click', (event) => { // get the `src` of the clicked image and pass it to the `openPreview` function const imageSource = event.target.src openPreview(i, imageSource); popup.classList.toggle('active'); }) }) const openPreview = (i, src) => { // let path = ``; largeImage.src = src; } closeBtn.addEventListener('click', () => { popup.classList.toggle('active'); })
-
Store image and users email in an array and print to screen?
Hi, thank-you for the reply, yes the webpage is very poor, but it is a training project for myself The question I was told to solve was as followed; 'attach an image to an email address and store it in an array? My first step is to add the image on the popup to an array [of images] and view the results in a gallery next to the main image. Moreover, I can't figure out how to add the existing popup image to a new array of images.
-
Store image and users email in an array and print to screen?
I have coded a small image gallery with a popup [of an image], but now I have to save the user choice of image(s) and email address and store both on screen. Moreover, I have been told to store the popup image(s) and the email in an array; I don't know how to add the popup image to an array. My codepen of the project. https://codepen.io/aaron_1986/pen/VwdvqWB
-
CSS curved edge with high slope?
Thank-you for the reply. I'm just searching youtube videos now for help
-
CSS curved edge with high slope?
I want to design a background with a very high (steep) edge to the right (see image). Moreover, I have only managed to create a stright line slope so far. https://i.imgur.com/ghRW2k4.png