Not logged in : Login

About:     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : schema:DiscussionForumPosting, within Data Space : associated with source document(s)

described by
  • #12
  • #13
  • 2018-06-04T05:43:53Z
  • Hi guys, this is my code and it’s currently working. What do you think? /* Looping through images */ for (i = 1; i <= 5; i++) { var newImage = document.createElement(‘img’); newImage.setAttribute(‘src’, ‘./images/pic’ + i + ‘.jpg’); thumbBar.appendChild(newImage); newImage.onclick = getTheImage; function getTheImage(e, src) { var src =‘src’); displayedImage.setAttribute(‘src’, src); }; }; /* Wiring up the Darken/Lighten button */ btn.onclick = changeOverlay; function changeOverlay () { var cl = btn.getAttribute(‘class’); if (cl === ‘dark’) { btn.setAttribute(‘class’, ‘light’); btn.textContent = ‘Lighten’; = ‘rgba(0,0,0,0.5)’; } else { btn.setAttribute(‘class’, ‘dark’); btn.textContent = ‘Darken’; = ‘rgba(0,0,0,0)’; } };
  • Hi Mattia, Your code doesn’t look too at at all — nice job! One bit of feedback I can give you — in the following block: function getTheImage(e, src) { var src ='src'); displayedImage.setAttribute('src', src); } } You don’t need to define the src parameter in the function, as you are getting src inside the function body in the second line instead. So the following would work fine: function getTheImage(e) { var src ='src'); displayedImage.setAttribute('src', src); } }
  • "Image gallery" assessment
is topic of
is container of of
is object of
is subject of
Faceted Search & Find service v1.17_git38 as of Aug 05 2019

Alternative Linked Data Documents: ODE     Content Formats:       RDF       ODATA       Microdata      About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.01.3307 as of May 21 2018, on Linux (x86_64-redhat-linux-gnu-ANALYTICS), Single-Server Edition (7 GB total memory)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2020 OpenLink Software