So I have a script that goes like:
$(".contenttitle,.contenttitle_half").click (function(){
$(this).next().stop().toggle();
$goran = $(this);
if ($(this).next().stop().is(':hidden')) { do something }
and it’s working. But the new script which should not onclick, but onload test if element is hidden isnt working:
jQuery(document).ready(function(){
if ($(".contenttitle").next().is(':hidden')) { DO SOMETHING }
and this one isn’t working for some reason. If I test $(".contenttitle").next() with console, it shows next elements, which means only .is(:hidden) isn’t working.
If you have more the 1 .contenttitle on the page try this: