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

Music News

Ed Sheeran doesn’t think he has the “pizzazz” for Super Bowl halftime show

"The catalogue that I have doesn’t really lend itself", the musician added

Lorde shares snippet of new music after wiping social media accounts

The singer has so far released a new album every four years, with fans speculating a follow-up to 2021's 'Solar Power' could be on the way this summer

Liam Payne’s friend Roger Nores voluntarily withdraws $10million defamation suit against late singer’s dad

Nores sued for defamation back in January, claiming Payne's dad was smearing him and mischaracterising their friendship

John Lydon lost part of his vinyl collection in kitchen blaze after insurance was cancelled, as he shares unusual collections

The former Sex Pistols frontman revealed that his late wife, Nora Forster, accidentally set their kitchen on fire

Blink-182’s Mark Hoppus opens up about difficult childhood: “It was awful growing up”

The musician reflected on the challenging divorce of his parents in a new interview

Garbage fight “fatalism and negativity” on George Floyd inspired new single ‘There’s No Future In Optimism’

It is the lead single from new album ‘ Let All That We Imagine Be The Light’, and new US tour dates have been shared too

Metallica release first trailer for new fan documentary ‘Metallica Saved My Life’

"It explores our world through the lives of fans who have supported each other through highs, lows, trials and triumphs for over four decades"

Listen to the surprise release of SHERELLE’s debut album ‘With A Vengeance’

The "cathartic and positive" LP contains the "bisexual anthem" 'Freaky (Just My Type)', featuring George Riley
Advertisement