Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6779627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:24:29+00:00 2026-05-26T16:24:29+00:00

<script type=text/javascript> clBoxActive = true; clBoxTrigger = cl-trigger; clBoxTriggerType = #; clBoxClass = overlay-box;

  • 0
<script type="text/javascript"> 
    clBoxActive = true;
    clBoxTrigger = "cl-trigger";
    clBoxTriggerType = "#";
    clBoxClass = "overlay-box";
    clEffectIn = "fade";
    clEffectOut = "fade";
    clOnLoad = false;
    clAllowExit = true;
</script>

This is what i currently have. Its options to do a lightbox like script where you click on the trigger, and it opens:

<div class="overlay-box" style="display:none;">
    <div class="ol-wrapper">
        <div class="ol-box-content">
            This is the overlay box content.
        </div>
    </div>
    <div class="ol-box-bg">&nbsp;</div> 
</div>

ol-box-bg is the background which the jquery pulls the height and width of the browser, and set the css to the box, and the rest is in style.css which it says position: absolute; and opacity, and other stuff to just style it to make it black with see through…

ol-box-content is the content box, its got a wrapper to allow it to center, but otherwise its got similar properties in the style.css as the ol-box-bg..

My question is… Im trying to make it a little more dynamic where i can allow multiple lightbox triggers that open different boxes to overlay the pages content. However i came across the problem of, the variables can only be set one time, and i have no clue where to go from here..

I notice that some people do stuff like:

optionName: optionvalue

but im not sure what it is, or how its used..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:24:29+00:00Added an answer on May 26, 2026 at 4:24 pm

    Might be a good option to create a plugin.

    Which would look something like:

    (function($){
        $.fn.extend({ 
            clBox: function(options) {
                var defaults = {
                    clBoxActive: true,
                    clBoxTrigger: 'cl-trigger',
                    clBoxTriggerType: '#',
                    clEffectIn: 'fade'
                }
    
                var options =  $.extend(defaults, options);
    
                return this.each(function() {
                    var obj = $(this);
    
                    // do stuff with matching elements
                    obj.click(function() {
                        // e.g. open lightbox
                    });
    
                    // to access an option simply use option.name
                    console.log(options.clBoxTrigger);             
                });
            }
        });
    })(jQuery);
    

    You can now use your plugin with either the default options or with custom options.

    $(document).ready(function() {
      // with default options
      $('.elements1').clBox();
    
      // with custom options
      $('.elements2').clBox({clBoxActive: false, clEffectIn: 'slide'});
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This my javascript :- <script type =text/javascript> $(function() { $(#tabs).tabs({ cache: true ,fx: {
<script type=text/javascript> function testing() { $.ajax({ type: POST, url: testing.php, data: call=+$(#abc).val(), success: function(msg){
Can someone show me whats wrong with this: <html> <script type = text/javascript> function
<?php echo <script type = 'text/javascript'></script>; ?> output's page source shows this : <script
I would like to add this code: <script type=text/javascript src=http://www.formstack.com/forms/js.php?1134414-uqmj2UXxEw-v2> </script> <noscript> <a href=http://www.formstack.com/forms/CampusEnterprises-chopped_greens_order_form__copy
Look this code: <script type = text/javascript> function mouseClick (container) { container.appendChild (document.createTextNode (Can
Below is the code for my YWA wrapper var astr_ywascript = (document.createElement(script).type = text/javascript).src
<?php $_SESSION['dsize'] = $_POST['dsize']; if ($_SESSION['deadline']==Urgent ) { ?> <script type = text/javascript> window.open('https://usd.swreg.org/cgi-bin/s.cgi?s=104597&p=104597-1&v=0&d=0&q=<?php
I have this code: <script type=text/javascript> function js() { var getJs = document.getElementById(jogo); if
<html> <head></head> <body> <script type = text/javascript> var x = 5; var y =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.