lw-bobbimartin / simplemodal

Automatically exported from code.google.com/p/simplemodal
0 stars 0 forks source link

plusin lost setting #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
SimpleModal or SimpleModal Contact Form (SMCF)?
[simpleModal]
Version of SimpleModal of SMCF (indicate Demo or WordPress plugin)?
[1.3.3]

Version of jQuery?
[1.3.2]

Browser/OS you are experiencing the problem with?
IE7 <win2003>

If applicable, please provide a code snippet or link to a website
demonstrating the problem.
============ simpleModal DIV: #imgdialog 
=======
<div id="imgdialog">        
            <div id="uploadimg_div" style="margin-top:10px;">
                add pics -> &nbsp;<input type="file" name="uploadify"
id="uploadify" />
            </div>
</div>
============== Upload plusin script ==========
  $("#uploadify").uploadify({
                    'uploader'       : 'images/temp/uploadify.swf',
                    'script'         : 'img_upload.aspx',
                    'auto'           : true,
                    'multi'          : false,
                    'fileDesc'       : "image files",
                    'fileExt'        : "*.jpg;*.png;*.jpeg;*.gif",
                    'cancelImg'      : 'images/cancel.png',
                'sizeLimit'      : "2000000",
                'height'         : '25',
                'width'          : '91'
  });
=============================
<input type="button" value="upload A/><input type="button" value="upload B"/>

I have 2 button to load the imgdialog div in simplemodal, when i click
buttonA ,the upload plusin work ok, but, when i close the simplemodal and
click buttonB, the upload plusin lost all the setting(fileDesc,fileExt  etc.)

If applicable, please list the other code/libraries/plugins you are trying
to integrate with.

Original issue reported on code.google.com by 380280...@qq.com on 22 Nov 2009 at 5:52

GoogleCodeExporter commented 9 years ago
Try setting up uploadify (calling it) in a SimpleModal onShow callback.

$('#imgdialog').modal({
  onShow: function (dialog) {
    $("#uploadify", dialog.data[0]).uploadify({
    'uploader'       : 'images/temp/uploadify.swf',
    'script'         : 'img_upload.aspx',
    'auto'           : true,
    'multi'          : false,
    'fileDesc'       : "image files",
    'fileExt'        : "*.jpg;*.png;*.jpeg;*.gif",
    'cancelImg'      : 'images/cancel.png',
        'sizeLimit'      : "2000000",
        'height'         : '25',
        'width'          : '91'
    });
  }
});

Original comment by emartin24 on 23 Feb 2010 at 4:08