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

Fix issue using WebUploader in Bootstrap blur box

亚连
Release: 2018-05-26 16:39:03
Original
1458 people have browsed it

This article mainly introduces the problems and solutions of using WebUploader in the Bootstrap fuzzy box. Friends who need it can refer to it

In my graduation project, there is a requirement in the Bootstrap fuzzy box. Display the upload button of WebUploader, the effect is as follows:

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

However, the actual effect is that when the blur box appears, the upload button cannot be clicked.

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 a click event for the button of the blur box, and perform uploader.refresh(( ); However, I seem to have 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

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

Method for ajax to synchronously verify whether the order number exists

js ajax processes json returned by the java background Method of creating an object loop into a table

Ajax method of obtaining data and then displaying it on the page

The above is the detailed content of Fix issue using WebUploader in Bootstrap blur 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!