Home > Web Front-end > JS Tutorial > body text

Detailed explanation of the steps to use WebUploader in the fuzzy box

php中世界最好的语言
Release: 2018-05-09 10:09:33
Original
1922 people have browsed it

This time I will bring you a detailed explanation of the steps for using WebUploader in the fuzzy box. What are the precautions for using WebUploader in the fuzzy box? Here is a practical case, let’s take a look.

In my graduation project, there is a requirement to display the Upload button of WebUploader in the Bootstrapfuzzy box. The effect is as follows:

We directly inserted the uploaded component into the blur box of Bootstrap:

However, the actual effect is that the blur box acts as a blur box After it appears, I cannot click the upload button.

However, after I pressed F12 to check if there was an error in the console, WebUploader could actually pop up the file selection box, and other functions were normal.

After reviewing the data, I found that the reason for the bug is that the length and width of the [Select File] button are both 0, and the web page needs to be re-rendered. F12 happens to have the function of rendering web pages. The solution is to re-render or instance Uploader. Need to be re-instantiated: uploader.refresh()

The first idea is to register the click event for the button of the fuzzy box, and do it when the fuzzy box pops upuploader.refresh(); However, there seemed to be other bugs after I made the modifications.

The final solution is to listen to the event triggered by the blur box, and then refresh the component:

$('#updateModal').on('shown.bs.modal',function() {//提示框显示时候触发
    uploader.refresh();   //刷新当前webUploder
 });
Copy after login

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other php Chinese websites related articles!

Recommended reading:

How Vue uses dynamically refreshed Echarts components

Detailed explanation of computed use cases in Vue.js

The above is the detailed content of Detailed explanation of the steps to use WebUploader in the fuzzy box. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template