I'm building a map with dots. When you click each dot, it opens up a <div>
with a form related to that dot.
Once you click the dot and the <div>
opens, when you click a different dot it closes that <div>
and the new form related to the recently clicked dot opens in <div>
.
How can I have the <div>
open once and never close unless the page is refreshed?
<script type="text/javascript">
$(document).ready(function(){
$(".slidingDiv").hide();
$(".dot").show();
$('.dot').click(function(){
$(".slidingDiv").slideToggle("slow");
});
});
</script>
<script>
jQuery(function(){
$('#showSingle').click(function(){
$('.targetDiv').show();
});
$('.dot').click(function(){
$('.targetDiv').hide();
$('#div'+$(this).attr('target')).show();
});
});
</script>