javascript - How to clear if there is no result -
i have map. whenever click state pulls distributors , shows up. however, if there no result database leaves previous 1 on page. want if there no result particular state make container empty. how can it?
$(document).ready(function() { $("#sc").click(function() { if ($("div.sc_info").is(":hidden")) { $("#repinfo_container div.info_cont").removeclass("active"); $("#repinfo_container div.info_cont").addclass("inactive"); $("div.sc_info").slidedown("fast"); $("div.sc_info").removeclass("inactive"); $("div.sc_info").addclass("active"); $("div.inactive").slideup("fast"); } else {} }); }); some more details picture. http://i.imgur.com/vozkp.png interactive distribution map. problem example in database have results(distributors) ca(california). when click pulls , shows @ bottom. however, if click la(state) since there no result shows previous clicked state's results. want if don't have results state want show container instead of showing previous result. hope makes more sense.
here source code of whole page
pastebin.com/mxydpzcx
what want if there no result particular state make container empty.
$("#repinfo_container").empty();
Comments
Post a Comment