`; // target the cover menu item const target = document.querySelector('#menu-header-uk-1 .menu-item-2911415'); // position popover to the left if the target is on the right half of the screen if (target.getBoundingClientRect().right > document.documentElement.clientWidth / 2) { popover.classList.add('left'); } target.appendChild(popover); // used to check if the article info let articleTitle = ''; // fetch info once, then show popover on hover target.addEventListener('mouseover', async () => { if (!articleTitle) { const [coverRes, articleRes] = await Promise.all([ fetch('https://www.nme.com/wp-json/wp/v2/posts?categories=268320&per_page=1&_fields[]=thumbnail_url&_fields[]=featured_media'), fetch('https://www.nme.com/wp-json/wp/v2/posts?categories=268101&per_page=1&_fields[]=title&_fields[]=link'), ]); const [cover, article] = await Promise.all([coverRes.json(), articleRes.json()]); articleTitle = article[0].title.rendered; document.querySelector('#the-cover-article-title').textContent = articleTitle; document.querySelector('#the-cover-article-title').href = article[0].link; document.querySelector('#the-cover-image-link').href = article[0].link; document.querySelector('#the-cover-read-now').href = article[0].link; document.querySelectorAll('#the-cover-image').forEach((img) => { // add size modifier to the cover image url img.src = cover[0].thumbnail_url.replace(/(\.[\w\d_-]+)$/i, '-400x500$1'); }); // document.querySelector('#the-cover-image-link').href = article[0].link; } setTimeout(() => popover.classList.add('active'), 0); }); // hide popover on mouse leave target.addEventListener('mouseleave', () => { setTimeout(() => popover.classList.remove('active'), 0); }); });

Film Features

What Wes Anderson fans need to know about new film ‘The Phoenician Scheme’

From the Anderson regulars in the cast to his award-winning cinematographer

How Wes Anderson’s movies are shaping new music

Five rising artists on their love for the Hollywood auteur

Everything we know about ‘Wicked Part Two’

The adaptation of the hit musical has been split into two parts

Here’s every ‘Star Wars’ TV series and film in the works

From ‘The Acolyte’ to Patty Jenkins’ ‘Rogue Squadron’

Here’s everything we know about the ‘Peaky Blinders’ movie

Tommy Shelby returns for an “explosive” new chapter… but will it be the last one?

Everything we know about ‘28 Years Later’ and its proposed sequels

The threequel to Danny Boyle’s ‘28 Days Later’ is due out next year

“’Dig!’ could never be made again”: why the drug-fuelled rock doc is the last of its kind

You won’t catch any modern bands hoovering up lines of gak on camera

The greatest fictional pop stars on film – ever!


Moretti joins the pantheon of unforgettable made-up movie musicians
Advertisement