Repository navigation
Popup System
Alee Javed edited this page Mar 1, 2026
·
1 revision
The popup system creates customizable modal windows with white theme styling, smooth animations, and flexible content management.
- Custom Content - Rich text and HTML content
- White Theme - Clean, modern popup styling
- Smooth Animations - Fade and slide effects
- Responsive Design - Works on all devices
- Trigger System - Multiple trigger options
- Auto-close - Optional auto-close functionality
Each popup includes:
- Overlay - Semi-transparent background
- Container - White popup container
- Close Button - Easy to close popup
- Title - Optional popup title
- Content - Rich text content
- Animations - Smooth open/close effects
Go to Popups in WordPress admin menu
- Popups β Add New
- Popup Title - Give your popup a title
- Content - Add your message using rich text editor
- Publish popup
- Rich Text Editor - Full formatting options
- HTML Support - Custom HTML content
- Shortcodes - WordPress shortcodes
- Images - Embedded images and media
<div class="aj-popup-overlay">
<div class="aj-popup-container">
<button class="aj-popup-close" aria-label="Close">Γ</button>
<h3 class="aj-popup-title">Popup Title</h3>
<div class="aj-popup-content">
<!-- Popup content here -->
</div>
</div>
</div>-
.aj-popup-overlay- Background overlay -
.aj-popup-container- Popup container -
.aj-popup-close- Close button -
.aj-popup-title- Popup title -
.aj-popup-content- Content area
.aj-popup-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 9999;
}
.aj-popup-container {
background: white;
border-radius: 12px;
max-width: 600px;
margin: 50px auto;
padding: 30px;
box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}:root {
--popup-overlay: rgba(0, 0, 0, 0.5);
--popup-bg: #ffffff;
--popup-border: #e0e0e0;
--popup-text: #1a1a1a;
}// Popup open/close functions
function openPopup(id) {
const popup = document.getElementById(`aj-popup-${id}`);
if (popup) {
popup.classList.add('aj-popup-open');
document.body.classList.add('aj-popup-open');
}
}
function closePopup(id) {
const popup = document.getElementById(`aj-popup-${id}`);
if (popup) {
popup.classList.remove('aj-popup-open');
document.body.classList.remove('aj-popup-open');
}
}.aj-popup-overlay {
opacity: 0;
transition: opacity 0.3s ease;
}
.aj-popup-open .aj-popup-overlay {
opacity: 1;
}
.aj-popup-container {
transform: scale(0.9);
opacity: 0;
transition: all 0.3s ease;
}
.aj-popup-open .aj-popup-container {
transform: scale(1);
opacity: 1;
}<!-- Button trigger -->
<button class="popup-trigger" data-popup-id="123">
Open Popup
</button>
<!-- Link trigger -->
<a href="#" class="popup-trigger" data-popup-id="123">
Open Popup
</a>// Programmatic trigger
document.addEventListener('DOMContentLoaded', function() {
const triggers = document.querySelectorAll('.popup-trigger');
triggers.forEach(trigger => {
trigger.addEventListener('click', function(e) {
e.preventDefault();
const popupId = this.getAttribute('data-popup-id');
openPopup(popupId);
});
});
});// Auto-close after 5 seconds
setTimeout(() => {
closePopup('popup-id');
}, 5000);
// Close on overlay click
document.querySelector('.aj-popup-overlay').addEventListener('click', function() {
closePopup('popup-id');
});- Centered popup - 600px max width
- Full animations - All effects enabled
- Keyboard navigation - Tab and escape support
- Slightly smaller - Optimized for tablets
- Touch-friendly - Larger close button
- Maintains animations - Core effects preserved
- Full width - Uses full screen width
- Simplified animations - Performance optimized
- Touch optimized - Better mobile experience
- Check posts - Ensure popups are published
- Verify template - Check popup output function
- Clear cache - Browser and WordPress cache
- Check JavaScript - Ensure popup.js is loading
- Check CSS - Ensure popup styles are loading
- Verify JavaScript - Check popup.js functionality
- Test browser - Try different browsers 4 - Check conflicts - Plugin or theme conflicts
- Check CSS - Ensure popup styles are loading
- Verify variables - Ensure CSS variables are set
- Test responsive - Check different screen sizes
- Check z-index - Ensure proper layering
/* Custom popup background */
.aj-popup-container {
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
border: 2px solid var(--accent);
}
/* Custom close button */
.aj-popup-close {
background: var(--accent);
color: white;
border-radius: 50%;
}
/* Custom animations */
.aj-popup-container {
animation: slideIn 0.5s ease-out;
}
@keyframes slideIn {
from {
transform: translateY(-50px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}// Custom popup triggers
document.addEventListener('DOMContentLoaded', function() {
// Auto-open popup after delay
setTimeout(() => {
openPopup('welcome-popup');
}, 3000);
// Close on escape key
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape') {
closePopup('welcome-popup');
}
});
});- Customization Guide - General customization
- Installation Guide - Setup instructions
- Birthday Cards - Related card system
- Troubleshooting - Common issues and solutions