My Wikipedia Viewer! Would love feedback!

My Wikipedia Viewer! Would love feedback!
0

#1

I would love some feedback on my Wikipedia viewer! Let me know if you find any bugs! Thanks for your help!


#2

Nice theme and smooth animations. But when I tried to search for the second time, the search box was pushed out of the page. I haven’t checked your code but seems like you didn’t remove the previous searched results before showing the new one.


#3

Thank you for pointing that out. I hadn’t noticed that! I looked back and I think it is because I change the top margin after the json request for the initial animation so it pushes it out of the page on the second one.

  $.getJSON(apiURL, function(json) {
        $("#searchBar").animate({'margin-top' : "-=18%"});
        $("#results").show(100);

I’m not quite sure how to fix that so it only happens the first time. I’ll have to do some research! Thank you for your feedback!


#4

Hi! I like your wikipedia viewer; simple but elegant. To fix the margin-top issue you could put your searchBar animate into an if statement, such as if($("#searchBar").css("margin-top", "20%)){$("#searchBar").animate({'margin-top' : "-=18%"});}.


#5

Thank you so much! That worked! And an easier fix than I was expecting. I appreciate the help!