Technical Details
Forum version : #phpBB2
Position : Founder
Concerned browser(s) : Google Chrome
Who the problem concerns : Yourself
Forum link : ( link is hidden, you must reply to see )
Description of problem
Hi! My problem is (as topic said script I try to use on my forum. It's not workin of course.Here's my script
- Code:
$(document).ready(function(){
$("div.dropdown-link").click(function(e) {
e.preventDefault();
var $div = $(this).next('.dropdown-container');
$(".dropdown-container").not($div).hide();
if ($div.is(":visible")) {
$div.hide()
} else {
$div.show();
}
});
$(document).click(function(e){
var p = $(e.target).closest('.dropdown').length
if (!p) {
$(".dropdown-container").hide();
}
});
});
- Code:
<div class="dropdown"><div class="dropdown-link">Options</div><div class="dropdown-container" style="display: none;">Some text here</div></div><div class="dropdown"><div class="dropdown-link" >Options</div><div class="dropdown-container" style="display: none;">Some text here</div></div><div class="dropdown"><div class="dropdown-link">Options</div><div class="dropdown-container" style="display: none;">More words etc.</div></div>
So, I'd like to know why it's not working on my forum while it's doing on jsfiddle. And it'd be great to get any tips what I can do to achieve similar effect.