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

Watch Ed Sheeran’s lyric video for new single ‘Perfect’

It's the fourth single from Divide...

Ed Sheeran has released the lyric video for his new single ‘Perfect’. You can watch it below.

The wistful ballad is the fourth single to be taken from his third album ‘Divide’ and comes after he previously release ‘Castle On The Hill’, ‘Shape Of You’ and ‘Galway Girl’ from the record.

Advertisement

The record is also the most successful UK album of 2017, after shifting 2.2 million albums in six months, while also holding 4 x Platinum and 10 x Gold certifications across the world.

Despite usually being found playing in cavernous stadiums these days, the singer took it back to basics earlier this week when he performed in the Washington DC home of Holly Branson, the daughter of Richard Branson, to raise funds for Amnesty International.

The intimate gig was part of the Give A Home 2017, which also saw The National performing in Edinburgh for the refugee charity event.

Last week, Ed Sheeran also teamed up with Skrillex for a surprise performance in Chicago.

Recommended

The pair were both in the Illinois city last Friday night (September 15) and appeared at the Five Roses venue where they made an unplanned performance.

During the performance, Skrillex played a 90-minute DJ set, while Sheeran acted as his hypeman.

You May Also Like

Advertisement

TRENDING

Advertisement

More Stories