modal multiple > Bootstrap/JS/PHP

Asked

Viewed 154 times

0

I used this link as a reference for creating my Modal: Open Multiple Bootstrap Modals.

After opening a modal and clicking outside the modal box, when we return to page, an automatic style of padding-right is opened:17px, and at each open modal it value is added with more 17px, result, the page will shrink to left on account of the padding.

I used F12 to check what is happening, 1st print taken at index, without opening modal: inserir a descrição da imagem aqui

2nd print taken with open modal: inserir a descrição da imagem aqui

I scanned behind some padding-right both in index, and in singles that is where the data for modal comes from, no padding was found.

{var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)}

As you can see in the print, the {} element is stating that it comes from the inline, which would be this?

Detail: If I click on a link inside the Modal, it does not create padding. Padding occurs only when I click outside the modal and it closes it.

  • Would anyone like to explain to me what this style element is(the)?

1 answer

0

I don’t know if it would be the best solution for your case, but you could add this attribute to your modal:

data-backdrop="static"

It disables modal close when it is clicked outside your area.

  • Today I was able to test on a monitor dell of 17" and saw that the problem did not occur... already where I am developing is a laptop with screen of 14" . I don’t know where to start looking for the problem...

  • 1

    Really, here I could not reproduce the problem... I am using a monitor of 17''.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.