HTMLGuyLLC / jAlert

jQuery alert/modal/lightbox plugin
https://htmlguyllc.github.io/jAlert/
MIT License
76 stars 35 forks source link

Is it possible to accept an dom object as content? #53

Closed KNVB closed 5 years ago

KNVB commented 6 years ago

As title,Is it possible to accept an dom object as content? It is because I need to add event handler for the content objects.

Besides that, an issue for noPadContent:true found, my code as the following:

$.jAlert({ noPadContent:true, 'title': "Select a Directory", 'content':msg, 'theme': 'red', closeBtn:false, 'btns': { 'text': 'Ok',class:"w3-red"} });

where msg=<div style="border:1px solid black;padding-top: 0px; margin-top: 0px;"> <ul style="padding: 0px; margin: 0px;"> <li style="margin-left: 10px; list-style: none;"><i class="fa fa-hdd-o"></i>&nbsp;<a rel="C:\" style="cursor: pointer;">C:\</a></li> <li style="margin-left: 10px; list-style: none;"><i class="fa fa-hdd-o"></i>&nbsp;<a rel="D:\" style="cursor: pointer;">D:\</a></li> <li style="margin-left: 10px; list-style: none;"><i class="fa fa-hdd-o"></i>&nbsp;<a rel="E:\" style="cursor: pointer;">E:\</a></li> <li style="margin-left: 10px; list-style: none;"><i class="fa fa-hdd-o"></i>&nbsp;<a rel="F:\" style="cursor: pointer;">F:\</a></li> <li style="margin-left: 10px; list-style: none;"><i class="fa fa-hdd-o"></i>&nbsp;<a rel="G:\" style="cursor: pointer;">G:\</a></li> </ul> </div>

The ok button row wider than bother content and title row.

HTMLGuyLLC commented 6 years ago

I considered this feature in the past. Next time I get to updating it, I will add. If someone else has a chance first, just open a pull request and I'll merge it.

HTMLGuyLLC commented 5 years ago

Latest version will automatically grab HTML of any dom element that is provided for the "content" property.