Bootstrap modal box jumps to the current template page box disappears and the solution to the problem of the background _javascript skills

Source: Internet
Author: User

This is a recent problem in doing a personal podcast system,

The scenario is as follows:


After I click on the delete button, pop up a modal box so that I choose to look Back page or, previous page, next page

Home There is nothing to say, is a direct jump, no problem

previous page, the next page is to jump to the previous or next, all the " article " is used is the same HTML template, so the page did not reload
So there's the problem, the modal box disappears, but the background doesn't go away.

I've been on the internet for a while, but I don't seem to have a problem with that.

1 So before I originally wanted to make this problem simple, direct "location = Prevurl;" Location.reload () ", but this feels inappropriate, request two times, for some of the data is not cached is more wasteful

So I've been looking for it on the Internet, but it's no use ...

2 then tried to add $ ("#myModal") to the button's event "Start/End" . Modal ({show:true}),/$ ("#myModal"). Modal ({ Backdrop:false, Show:true})/$ ("#myModal"). Modal ("Hide") et cetera
But it's still not going to work.

3 and then a modern one, why don't I look at the HTML in the background and the HTML for the normal current page, and say that you can't find the problem.

Go [start of war]

1 This is the time when the page is normal

2 This is the time when the modal box comes out.

3) then I clicked on the previous page

Compared to the original page "1" 1. One more div, 2. and the body plus a class attribute

4) Then I removed the div

With the above page changes in the page that the background does not exist, but I still can not control the mouse page movement

5) Then I removed the class attribute of the body

Compared to a page, I can now move the mouse, changed back to the normal page

Problem Solving

Nice, the original solve the two places on the AH, fix it!

The real reason for this problem, I don't know, is why this happens under this scenario

Reference :

1, http://www.jb51.net/article/32590.htm

2, http://www.runoob.com/bootstrap/bootstrap-v2-modal-plugin.html

3, Baidu know: How to control the modal window to submit, modal window closed, jump back to the main page, instead of opening another page?

Modal window embedded an IFRAME in the IFRAME to write the background code, and then you can use JS Control modal window close or jump.

For more information, please click on the topic "Bootstrap Modal use Tutorial" to learn, I hope you like.

If you want to further study bootstrap, you can click here to learn, and then attach 3 wonderful topics:

Bootstrap Learning Course

Bootstrap Practical Course

Bootstrap Table Use Tutorial

Bootstrap Plugin Usage Tutorial

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.