HTMLGuyLLC / jAlert

jQuery alert/modal/lightbox plugin
https://htmlguyllc.github.io/jAlert/
MIT License
76 stars 35 forks source link

Allow document body scroll #27

Closed apod42 closed 8 years ago

apod42 commented 8 years ago

Hello! When an alert pops-up, the vertical scrollbar is hidden and page body is no longer scrollable. Any way to prevent this behaviour? In the plugin options have found nothing related... Thank you!

HTMLGuyLLC commented 8 years ago

So you want the popup to display with the black background, but the regular page to be scrollable as well?

apod42 commented 8 years ago

I don't want any overlay (black background) to be displayed over the page. And yes, the regular page should be scrollable. Any way to do this please?

HTMLGuyLLC commented 8 years ago

Do you also want the alert to be movable?

apod42 commented 8 years ago

Shane, no, I don't want the alert to be movable. Just to keep centered on page resize, as it does now.

Emil

HTMLGuyLLC commented 8 years ago

I'm just trying to fully understand what you're looking for so that I can decide if it's a useful feature to add for everyone, or too specific of a use-case. I could see it being a desired feature to say "Ok, I want a popup that doesn't cover any content. One that people can move around to see what's underneath" (for instance, this could contain an editable field and maybe you need to refer to the page's content to fill it in), but to just have one that sits in the middle over stuff while you scroll sounds too specific for most people to want..so instead of making that a feature of the plugin, I'll just tell you how to do it for your implementation. One moment.

HTMLGuyLLC commented 8 years ago

Comment out line 280 of jAlert-v3.js //$('body').css('overflow', 'hidden');

That might be all you need to do. I can't test right now, but let me know if that works. Since you didn't ask about the background, I'm assuming you already removed that on your own?

apod42 commented 8 years ago

Thank you, works great! Now I just need to get rid of the background, please do tell :)

HTMLGuyLLC commented 8 years ago

2 Options:

1: Comment out line 131 of jAlert //backgroundClasses.push('jawrap'+thisAlert.options.backgroundColor);

2: Pass a bunk background color like pink $.jAlert({ 'title':'Hi', 'content':'Sup?', 'backgroundColor':'pink' });

HTMLGuyLLC commented 8 years ago

Scrap that. The second one won't work because it validates the background color. You'd have to also add it to the backgroundColors array.

HTMLGuyLLC commented 8 years ago

Just comment out line 131 of jAlert.js. lol.

apod42 commented 8 years ago

Thank you! Great success :)

HTMLGuyLLC commented 8 years ago

No problem :)