Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1492126

    Dear Support.

    Can you recommend a solution or PlugIn to create a feature similar to this website: https://immosell.ch/
    Also once the box is closed there is an information Icon that can bring the box back. Also on my page I am using your scroll to the top icon which I would like to keep under the box if the box is showing and next to the Information icon once the box is closed.

    Thanks for advise.

    Regards
    Stefan

    #1492140

    Hey ti2media,
    Try adding this snippet to your child theme functions.php:

    function add_sticky_info_box() {
        ?>
        <style>
            .sticky-info-box {
                position: fixed;
                bottom: 120px;
                right: 20px;
                width: 300px;
                height: 300px;
                background: #ffffff;
                border: 1px solid #ddd;
                border-radius: 8px;
                box-shadow: 0 4px 12px rgba(0,0,0,0.15);
                z-index: 9999;
                display: flex;
                flex-direction: column;
                padding: 20px;
                box-sizing: border-box;
                transition: opacity 0.3s ease;
            }
            
            .sticky-info-box.hidden {
                display: none;
            }
            
            .sticky-info-box-header {
                display: flex;
                justify-content: space-between;
                align-items: flex-start;
                margin-bottom: 15px;
            }
            
            .sticky-info-box-title {
                font-size: 20px;
                font-weight: bold;
                color: #333;
                margin: 0;
                flex: 1;
            }
            
            .sticky-info-box-close {
                background: none;
                border: none;
                font-size: 24px;
                color: #999;
                cursor: pointer;
                padding: 0;
                width: 30px;
                height: 30px;
                display: flex;
                align-items: center;
                justify-content: center;
                transition: color 0.2s ease;
            }
            
            .sticky-info-box-close:hover {
                color: #333;
            }
            
            .sticky-info-box-message {
                flex: 1;
                color: #666;
                font-size: 14px;
                line-height: 1.6;
                margin-bottom: 20px;
                overflow-y: auto;
            }
            
            .sticky-info-box-button {
                background: #0073aa;
                color: white;
                border: none;
                padding: 12px 24px;
                border-radius: 4px;
                font-size: 16px;
                cursor: pointer;
                text-decoration: none;
                display: inline-block;
                text-align: center;
                transition: background 0.2s ease;
            }
            
            .sticky-info-box-button:hover {
                background: #005a87;
            }
            
            .sticky-info-toggle {
                position: fixed;
                bottom: 120px;
                right: 50px;
                width: 50px;
                height: 50px;
                background: #0073aa;
                color: white;
                border: none;
                border-radius: 50%;
                font-size: 24px;
                cursor: pointer;
                box-shadow: 0 4px 12px rgba(0,0,0,0.15);
                z-index: 9998;
                display: none;
                align-items: center;
                justify-content: center;
                transition: background 0.2s ease;
            }
            
            .sticky-info-toggle:hover {
                background: #005a87;
            }
            
            .sticky-info-toggle.visible {
                display: flex;
            }
        </style>
        
        <div class="sticky-info-box" id="stickyInfoBox">
            <div class="sticky-info-box-header">
                <h3 class="sticky-info-box-title">Important Information</h3>
                <button class="sticky-info-box-close" id="closeInfoBox" aria-label="Close">×</button>
            </div>
            <div class="sticky-info-box-message">
                <p>This is your information box! You can customize this message to display any content you'd like to share with your visitors.</p>
            </div>
            <a href="/your-page-url" class="sticky-info-box-button">Learn More</a>
        </div>
        
        <button class="sticky-info-toggle" id="infoToggle" aria-label="Show information">ℹ</button>
        
        <script>
            (function() {
                var infoBox = document.getElementById('stickyInfoBox');
                var closeBtn = document.getElementById('closeInfoBox');
                var toggleBtn = document.getElementById('infoToggle');
                
                // Close the info box
                closeBtn.addEventListener('click', function() {
                    infoBox.classList.add('hidden');
                    toggleBtn.classList.add('visible');
                });
                
                // Show the info box again
                toggleBtn.addEventListener('click', function() {
                    infoBox.classList.remove('hidden');
                    toggleBtn.classList.remove('visible');
                });
            })();
        </script>
        <?php
    }
    add_action('wp_footer', 'add_sticky_info_box');
    

    Then adjust the title, message, buttone text & link to suit. You can also adjust the CSS to change colors, etc.
    It places the box & info button 120px from the bottom so they are above the scroll-top button, ratio than have them move if the scroll-top shows, which would not be so good.
    fIPHs99.md.png
    fIPJ6iv.md.png

    Best regards,
    Mike

    #1492142

    Hey Mike…

    this is absolutely amazing. Almost perfection. So great! Thanks.
    One last question…

    Is it possible to keep the status, even if I click on other subpages. It reloads and opens again, even I closed it once. Once closed it would be great that it stays close while navigating within the site.

    Also is it possible to have one in German and also have one for English since the site is multi language.

    Regards
    Stefan

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.