Here on this website, I am utilizing two instances of jQuery - one for an "anything slider" and another for a toggle that hides and shows content.
When I remove the link to jQuery for the toggle feature, the slider works fine but the toggle does not. Here is the link to the jQuery for the toggle:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
Does anyone have any suggestions on how I can make both functionalities work smoothly together?
Thank you!
The full code snippet in question looks like this:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
<script>
$(document).ready(function() {
$('.nav-toggle').click(function(){
//get collapse content selector
var collapse_content_selector = $(this).attr('href');
//make the collapse content to be shown or hide
var toggle_switch = $(this);
$(collapse_content_selector).toggle(function(){
if($(this).css('display')=='none'){
toggle_switch.html('Learn More');//change the button label to be 'Show'
}else{
toggle_switch.html('Condense');//change the button label to be 'Hide'
}
});
});
});
</script>