Results 1 to 4 of 4

Thread: LBGW AJAX deactivate alternative

  1. #1
    Join Date
    Jun 2008
    Posts
    9
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default LBGW AJAX deactivate alternative

    Hi,

    Am using LBGW with AJAX content and need to know how to make the equivalent of :

    Code:
    <a href="#" class="lbAction" rel="deactivate" >
    have tried
    Code:
    <a href="#" class="lbAction" rel="deactivate" onmouseover="if(!this.onclick)new lightbox(this);">
    please help

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The javascript command to deactivate is:

    Code:
    lightbox.prototype.deactivate();
    But you might want to use (from the instructions) instead:

    Linking to a Another Lightbox within a Lightbox

    If you want to load a different lightbox within an already open lightbox set the rel attribute to insert and your href to the file you want to load instead.

    Code:
    <a href="confirm.html" class="lbAction" rel="insert">Go to Another Lightbox</a>
    The reason being that you have to be careful what events and in what order you assign to a link that you give (at any point) lightbox control over - it may overwrite them (in which case they won't fire at all), or the order in which you do things may need to be other than you may at first imagine (in which case the result may be other than expected), better to let lightbox handle things if at all possible.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jun 2008
    Posts
    9
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    ...thanks used onclick with

    Code:
    lightbox.prototype.deactivate();
    as this content is created by an AJAX call the rel tags arent picked up
    by LBGW script... i think ;-)

    thanks again MG

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Glad you're apparently satisfied, but it occurs to me that once your onmouseover event fires, the hardcoded onclick event of the link will be overwritten. If I'm right about that, you never needed the onclick to begin with.

    And further though, that if you are still using:

    Code:
     onmouseover="if(!this.onclick)new lightbox(this);"
    Your onmouseover event won't fire.

    But perhaps you no longer needed the mouseover event because all you wanted was to close the lightbox. In which case I completely understand.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •