Answer the question
In order to leave comments, you need to log in
Is it possible to design a GridView like the start screen of a Windows 8.1 phone?
I would like to implement in my application the same grid as on the start screen of the phone - transparent tiles with icons, and under them a background image. At the same time, only the tiles have transparency, and all the indents and the rest of the space are opaque.
In general, it is interesting whether this is possible in principle by means of markup in xaml?
Answer the question
In order to leave comments, you need to log in
Your code is most likely executed even before the DOM is loaded, try to move the script into a function and call it on the DOMContentLoaded event
function ready() {
var blockIds = [];
var blocks = document.querySelectorAll('[data-box-id] a');
blocks.forEach(block => block.addEventListener('click', e => {
blockIds.push(e.target.parentNode.getAttribute('data-box-id'));
e.target.parentNode.style.display = 'none';
localStorage.setItem('blocks', JSON.stringify(blockIds));
console.log(localStorage.getItem('blocks'));
}))
}
document.addEventListener("DOMContentLoaded", ready());
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question