Skip to content

Commit ec35cbd

Browse files
committed
using querySelector to hide frames and imp tags when not in use
1 parent 79be965 commit ec35cbd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

script.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ function getFetch(){
1010
console.log(data)
1111
if (data.media_type === 'image'){
1212
document.querySelector('img').src = data.hdurl
13+
document.querySelector('iframe').style.display = 'none'
1314
} else if (data.media_type === 'video'){
1415
document.querySelector('iframe').src = data.url
16+
document.querySelector('img').style.display = 'none'
1517
}
1618
document.querySelector('h2').innerText = data.title
1719
document.querySelector('p').innerText = data.explanation

0 commit comments

Comments
 (0)