how to add and remove a class when bootstrap popup is scroll

if you need scroll to whole popup (class="modal"): 

$(function () { $('.modal').scroll(function ()
 { var totop = 50; if ($(this).scrollTop() >= totop) { $(".mycountry").addClass("fix"); }
 else { $(".mycountry").removeClass("fix"); } }); });

 if you need scroll to modal content (class="modal-content"):

 $(function () { $('.modal-content').scroll(function ()
 { var totop = 50; if ($(this).scrollTop() >= totop) { $(".mycountry").addClass("fix"); }
 else { $(".mycountry").removeClass("fix"); } }); });

 

admin
Leave a Reply

Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages