The webuploader cannot be correctly initialized when it is put into the bootstap tab-content.
Symptom:
If webuploader is added to the tab component of BootStrap and is not a response page, the "open file" dialog box does not pop up.
Cause:
The webuploader initialization has a condition that it cannot be a hidden element. If it is a hidden element, the event cannot be correctly bound.
Solution:
You can add it to the shown. bs. tab event of the tab. If it is a specified tab page, re-Initialize an uploader.
This also introduces a restriction that the uploader initialization action must be written as a function, otherwise it will lead to a very long js file.
- $ ('A [data-toggle = "tab"] '). on ('shown. bs. tab', function (e ){
- Var target Export e.tar get. toString (); // values (e.tar get) [0]. hash;
- If (target. indexOf ('product _ gallary ')> 0 ){
-
- InitUpload ();
- }
- })
Other Instructions:
12.16e.tar get returns a DOM object;
2. For the bootstarp tab, you can simply use the hash attribute of jquery. This attribute is not described in jquery manuals, and it refers to the # id part of the url.
---- End -----