Skip to content

Commit

Permalink
easy scroll view
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhiscoding committed Jan 28, 2024
1 parent a6189e5 commit 6585e51
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ search_btn.addEventListener('click', function(){
if(artisturl.value){
url_temp = String(artisturl.value);
getArtist(url_temp);
var searchSection = document.querySelector('.output');
searchSection.scrollIntoView({ behavior: 'smooth' });
}
if(artistname.value){
url_fun = getArtisturl(artistname.value);
url_fun.then((result)=>{
url_temp = result;
getArtist(url_temp);
var searchSection = document.querySelector('.output');
searchSection.scrollIntoView({ behavior: 'smooth' });
})
}
}
Expand Down Expand Up @@ -267,6 +271,9 @@ compare_btn.addEventListener('click', function(){
return data1;
})
}

var searchSection = document.querySelector('#cmprout');
searchSection.scrollIntoView({ behavior: 'smooth' });
}else{
window.alert("Fill Both Fields");
}
Expand Down

0 comments on commit 6585e51

Please sign in to comment.