`; // 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); }); });

TV Reviews

‘MobLand’ review: Guy Ritchie goes lock stock for his own dated schtick

The director has somehow roped in Tom Hardy, Pierce Brosnan and Helen Mirren for this funny but familiar crime caper

‘This City Is Ours’ review: Merseyside mob drama offers more than drugs and violence

Sean Bean leads a chaotic crime family who are missing a shipment of cocaine

‘Hyper Knife’ review: satiate your morbid curiosity

A renowned neurosurgeon has to face his twisted former student when he requires a near-impossible, life-saving surgery

‘Adolescence’ review: Stephen Graham’s terrifying warning about toxic masculinity

Netflix’s legal thriller is an unflinching look at the rise of the manosphere

‘Daredevil: Born Again’ review: brutal re-origin story is Marvel’s best work yet

It may be a continuation of the beloved Netflix series but there’s more than nostalgia at play here

‘Buried Hearts’ review: a tangled web of deceit

Disney+’s latest K-drama stars Park Hyung-sik as an ambitious company director on a quest for vengeance

‘A Thousand Blows’ review: knockout drama is more than just Peaky Bruisers

You'll be pleased to know a second season of the Victorian-era boxing drama has already been filmed

‘Melo Movie’ review: to fill the ‘Our Beloved Summer’-shaped hole in your heart

Netflix’s latest K-drama isn’t writer Lee Na-eun’s best work, but her knack for creating a cute romcom still shines through

‘The White Lotus’ season three review: irresistible holiday soap remains TV’s most essential destination

Fan-favorite Tanya might be gone but there’s a new batch of garish guests to fall in love with
Advertisement