Whenever I click a link in my navigation, I want to remove certain images from the page. I tried implementing a solution, but now I have two empty spaces where the images used to be. How can I remove those as well? I searched on Stack Overflow for a solution, but the suggestions there didn't fully work with my particular implementation.
Although I didn't include all the HTML code, I only included the relevant parts related to the bxslider on my webpage.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.bxslider').bxSlider({
speed: 1000,
auto: true,
autoControls: false,
pager: false,
autoHover: true,
autoControlsCombine: true,
pause: 5000,
mode: 'fade'
});
});
function nocontext(e) {
var clickedTag = (e == null) ? event.srcElement.tagName : e.target.tagName;
if (clickedTag == "IMG")
return false;
}
document.oncontextmenu = nocontext;
$(document).ready(function(){
$(".nav").localScroll({duration:300});
$(".cityskapes-link").click(function(){
$(".animals").remove();
$(".bxslider").reloadSlider();
});
});
</script>
<link href="css/jquery.bxslider.css" rel="stylesheet" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link rel="stylesheet" href="css/photo.css">
<title>Photography</title>
</head>
<body>
<!-- Nav -->
<div class="nav">
<h1>TIRTH THE ARTIST PHOTOGRAPHY</h1>
<ul id="nav-link-container">
<li><a class="cityskapes-link" id = "nav-link">Cityskapes</a></li>
<li><a class="animals-link" id = "nav-link">Animals</a></li>
<li><a class="people-link" id = "nav-link">People</a></li>
<li><a class="misc-link" id = "nav-link">Misc</a></li>
</ul>
</div>
<!-- Picture Slideshow -->
<div id="slider">
<ul class="bxslider">
<li class="cityscapes"><img src="photos/NYC_Skyline_Revised.jpg"></li>
<li class="cityscapes"><img src="photos/MinionDrawing-1.jpg"></li>
<li class="animals"><img src="photos/NYC_Skyline_Daytime.jpg"></li>
<li class="animals"><img src="photos/HeavenlySunrise-2.jpg"></li>
</ul>
</div>