hoshiii Posted January 28, 2014 Share Posted January 28, 2014 I have this code: checkbox : function(elem) { $(function() { var isChecked = elem.checked, $check = $(this).val(), $address = $('.'+ elem.id); $image = $('.imagenone'); if(isChecked) { $address.stop().fadeIn("slow").css("display","inline-block"); $image.stop().fadeOut("slow").css("display","none"); } else { $address.stop().fadeOut("slow"); } }); } I need check if id of "$address"(class) displayed, not display other div with same id. I have a "query" which lists all the "rows" of the table, each "row" has a sub-category and associated product, which in my case the sub-category is the class and id is the product. but for different sub-categories can have the same product, not wanting to give the same id / product appear in duplicate. the problem is that there are only checkboxes for sub-categories, where the purpose is to create a filter. where all products with this sub-category, choosing more than one sub-category to check the sub-category appear. In different sub-category may contain the same products, just wanting to appear only once, and not repeated, ie not appear divs with the same id (same product) in duplicate. Structure Product List - http://s30.postimg.org/p0j37jl01/coding.jpg ps: sorry my bad english ! Quote Link to comment https://forums.phpfreaks.com/topic/285744-check-id-of-div-and-dont-allow-show-if-same-id-of-other-displayed/ Share on other sites More sharing options...
jburridge Posted February 2, 2014 Share Posted February 2, 2014 (edited) if (document.getElementById('myDivId') == null) { display the other div } else { don't display the other div } Edited February 2, 2014 by jburridge Quote Link to comment https://forums.phpfreaks.com/topic/285744-check-id-of-div-and-dont-allow-show-if-same-id-of-other-displayed/#findComment-1467437 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.