I have css classes such as .blue, .red etc that define background colors. I want to add specific class to div containing class 'fancybox-title', depending on the id that belongs to the fancybox
<div class="fancybox-skin">
<div class="fancybox-title fancybox-title-inside-wrap">Welcome</div> //here I want to add class, for example '.blue'...
<div class="fancybox-outer">
<div class="fancybox-inner">
<div style="display: block;" id="login-register-fancybox"></div> //depending on the ID from this line of code
</div>
</div>
</div>
I've had several attempts inside of:
$('.fancybox').fancybox({
'beforeLoad': function(){
}
});
including trying to find elements by ID, switches etc, but scripts started to look to big and to messy while not giving me desired result. I believe there is much simpler way to accomplish that, just can't figure it out. Can anyone help?
<div id="register">,<div id="login">), but fancybox automaticaly locates them inside of<div class="fancybox-inner">structure, while.fancybox-titleis placed higher in the structure, as per example in my question. So I need to dig out that ID in order to define which class should be added to the title... and how to get that done is still a mystery - Pejs