Modals

Adding custom class to the modal with data-modal-class-name

6 months 3 weeks ago #78381

Jay Haydon's Avatar Jay Haydon

Hi Peter

Although I did my research through the forum and checked carefully the plugin settings, I wonder why on one site it is possible to add a custom class through a

data-modal-class-name
attribute to the very modal link, and the modal will successfully apply the class to the
#colorbox
wrapper, but on the others it just don't want to do that.

Example link:
<a href="/somepage" class="modal" data-modal-class-name="my_custom_class">Some modal link</a>

BTW, is this the right way to go in order to add custom class to the modal, or is there some other way?

Thanks!

Plugin version: Modals v9.8.1 [PRO]
Joomla version: 3.8.3

6 months 3 weeks ago #78383

Peter van Westen's Avatar Peter van Westen Admin

Just use the {modal} tag to create the link and add a classname attribute.

6 months 3 weeks ago #78385

Jay Haydon's Avatar Jay Haydon

Thanks, I also just tried that before. Used:

{modal url="/my-video-link" class="btn btn-default btn-lg" classname="video-modal"}Video Link{/modal}

But I see not colorbox video-modal class appended:
<div id="colorbox" role="dialog" tabindex="-1" style="display: block; visibility: visible; top: 0px; left: 0px; position: absolute; width: 11005px; height: 5708px;">

Any more insight on this?

6 months 3 weeks ago #78390

Peter van Westen's Avatar Peter van Westen Admin

Working fine for me. Make sure there is no hidden html in your markup.
Do you have this online so I can take a look?