Alimon Karim Alimon Karim - 1 year ago 267
jQuery Question

Bootstrap body auto padding remove after open modal

After open bootstrap modal a auto padding-right : 19px adding in body tag. I want to remove this auto padding. I have tried bellow code for modal and remove body auto padding.

<div class="media" data-toggle="modal" data-target="#kolpochitro">

Then I have written

<div class="modal fade" id="kolpochitro" role="dialog">
<div class="modal-dialog modal-sm" >

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<div class="modal-body">


After open modal my body tag looking at firebug

<body class="cbp-spmenu-push modal-open" style="padding-right: 19px;">

for remove this style I am trying bellow code


But it's not working.

Answer Source

Use shown function for updating it:

$('#modal-content').on('', function() {

Or For Previous version Bootstrap :

$('#modal-content').on('shown', function() {

For more information check this link

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download