Skip to content

Commit 47fcbba

Browse files
author
VersatilityWerks
committed
added imageWidth (default auto)
1 parent e62235b commit 47fcbba

File tree

2 files changed

+169
-3
lines changed

2 files changed

+169
-3
lines changed

src/jAlert-v3.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,12 @@
127127
{
128128
alert.options.content = "<div class='ja_media_wrap'>"+
129129
loader+
130-
"<img src='"+alert.options.image+"' class='ja_img' "+onload+">"+
130+
"<img src='"+alert.options.image+"' class='ja_img' "+onload+"'";
131+
if( alert.options.imageWidth )
132+
{
133+
alert.options.content += " style='width: "+alert.options.imageWidth+"'";
134+
}
135+
alert.options.content += ">"+
131136
"</div>";
132137
}
133138
else if( alert.options.video )
@@ -639,7 +644,8 @@
639644
$.fn.jAlert.defaults = {
640645
'title': false, //title for the popup (false = don't show)
641646
'content': false, //html for the popup (replaced if you use image, ajax, or iframe)
642-
'image': false, //adds a centered img tag with max-width: 100%; width: auto;
647+
'image': false, //adds a centered img tag
648+
'imageWidth': 'auto', //defaults to max-width: 100%; width: auto;
643649
'video': false, //adds a responsive iframe video - value is the "src" of the iframe
644650
'ajax': false, //uses ajax call to get contents
645651
'onAjaxFail': function(alert, errorThrown){ //callback for when ajax fails

0 commit comments

Comments
 (0)