Logo

BongoLib Documentation

A JavaScript library for UI control and security features

Introduction

BongoLib is a JavaScript library providing two main functionalities: preventing users from using right-click or Ctrl+U, and dynamically hiding or showing elements.

Installation

Include BongoLib in your project by adding a script tag to your HTML:

<script src="https://https://bongolib.netlify.app/BongoLib.js"></script>

Usage

Once you've included the script in your HTML, you can use the library’s functions as follows:

Example 1: Hide and Show Elements


document.addEventListener('DOMContentLoaded', () => {
    const { HideShow } = BongoLib;

    // Hide element with ID 'example1'
    HideShow('hide', 3000, 'example1');
    
    // Show element with ID 'example2' after 3 seconds
    setTimeout(() => HideShow('show', 0, 'example2'), 3000);
    
    // Hide element with ID 'example3' immediately
    HideShow('hide', 0, 'example3');
    
    // Show element with ID 'example4' immediately
    HideShow('show', 0, 'example4');
    
    // Hide element with ID 'example5' and show it again after 3 seconds
    HideShow('hide', 3000, 'example5');
    setTimeout(() => HideShow('show', 0, 'example5'), 3000);
});
                
Back to API Reference

Example 2: NoSee Function


document.addEventListener('DOMContentLoaded', () => {
    const { NoSee } = BongoLib;

    // Prevent right-click and Ctrl+U
    NoSee();
});
                
Back to API Reference

Example 3: Combined HideShow and NoSee


document.addEventListener('DOMContentLoaded', () => {
    const { HideShow, NoSee } = BongoLib;

    // Prevent right-click and Ctrl+U
    NoSee();

    // Hide element with ID 'example6' for 2 seconds, then show it again
    HideShow('hide', 2000, 'example6');
    setTimeout(() => HideShow('show', 0, 'example6'), 2000);
    
    // Hide and show elements with IDs 'example7' and 'example8'
    HideShow('hide', 1000, 'example7');
    setTimeout(() => HideShow('show', 1000, 'example8'), 1000);
});
                
Back to API Reference

API Reference

BongoLib

NoSee()

Prevents right-click and keyboard shortcuts like Ctrl+U.

HideShow(action, duration, ...elements)

Hides or shows elements based on their IDs or class names. Use 'hide' or 'show' as the action, specify the duration in milliseconds for the action to complete.

Contact

If you have any questions or suggestions, feel free to reach out:

Instagram: bongo_cat_studios

Discord: Isusgsue