The webuploader cannot be correctly initialized when it is put into the bootstap tab-content.

Source: Internet
Author: User

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.

  1. $ ('A [data-toggle = "tab"] '). on ('shown. bs. tab', function (e ){
  2. Var target Export e.tar get. toString (); // values (e.tar get) [0]. hash;

  3. If (target. indexOf ('product _ gallary ')> 0 ){

  4. InitUpload ();
  5. }
  6. })

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 -----

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.