Remove the padding right modal on navigation


Topic: Remove the padding right modal on navigation

Neanrakyr pro asked 6 years ago

Hello, today I install the modal button in my navigation. When I click on the icon I see a style who appared on my body: style="padding-right: 17px;" I would like to know how to remove it, because each time i click on the button all my menu move. Thank you

Manuel Remus Stanca commented 6 years ago

put 0 iof 17px

Marta Szymanska staff pro premium answered 6 years ago

Hi Neanrakyr, is the Manuel Remus Stanca's answer fine for you? Best, Marta

LauraPitskhelauri pro answered 6 years ago

Hi, I had same problem, i found solution by removing class .fade https://stackoverflow.com/questions/32862394/bootstrap-modals-keep-adding-padding-right-to-body-after-closed

Marta Szymanska staff pro premium commented 6 years ago

OK, great.

Also, try this, body { padding-right: 0 !important }its literally solve my problem


Add in JS

modal.on('show.bs.modal', function () {
    $('body').addClass('modal-padding-overlap');
});

Add in CSS

.modal-padding-overlap[style] {
    padding-right:0 !important;
    padding-left: 0 !important;
}

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No