How to autoload lightbox on 'elseif' situation

Discussion in 'JavaScript' started by Hipto, Dec 1, 2010.

  1. #1
    Hey guys, I found this simple lightbox js >> http://www.cssjockey.com/files/downloads/code/jquery_css_lightbox/index.htm

    The lightbox will show if we click on the link. But how do we make it auto load under some circumstances:

    <script type="text/javascript">

    if (document.getElementById('adc').clientHeight < 20) {
    what's the code to add here so that the lighbox will show?;
    }</script>
     
    Hipto, Dec 1, 2010 IP
  2. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #2
    If you have the code from the tutorial in your html just add after the 2 click events this : $('a#show-panel').trigger('click');
     
    tvoodoo, Dec 3, 2010 IP
  3. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Or directly $("#lightbox, #lightbox-panel").fadeIn(300);
     
    tvoodoo, Dec 3, 2010 IP