It turns out that following the documentation of the library fancybox I find that to define the behavior of its elements through classes, a syntax must be followed like the following:
<a href="http://www.dominio-ejemplo.mx/pagina" class="fancybox.iframe">
<!-- Código HTML -->
</a>
I want to add " x " behaviors through jQuery to that type of elements, but I find that even escaping the character of "." (period) with the backslash () does not take the element.
I leave the following snippet:
$(function(){
$('button').on('click', function(){
/* No funciona */
$('.fancybox\.image').remove();
});
});
.fancybox\.iframe {
color: white;
background-color: red;
}
.fancybox\.image {
color: white;
background-color: green;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<ul>
<li>
<a href="http://www.dominio-ejemplo.mx/pagina" class="fancybox.iframe">Estilo iframe</a>
</li>
<li>
<a href="http://www.dominio-ejemplo.mx/pagina" class="fancybox.image">Estilo imagen</a>
</li>
</ul>
<button>Borrar: fancybox.iframe</button>