Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript in lightbox

    I was wondering if it is possible to embed javascript within a lightbox. I believe a lightbox in most cases uses its own javascript code, but i am looking to have an unrelated javascript function working within the lightbox, under the image, if possible.

    Thanks in advance.
    Last edited by bentsy10; 09-07-2009 at 12:59 AM.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,630 Times in 4,593 Posts
    Ummm...you know, you *can* just write your own lightbox code. In which case the answer is always "yes." But if you are using somebody else's code, then it would help to tell us *WHICH* code.

    Almost surely the answer is still "yes," but exactly how you go about it may depend on the lightbox framework you use.

  • #3
    New Coder
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for the reply.

    I am using the Wordpress plugin version of the Slimbox 2 lightbox, as described here: http://wordpress.org/extend/plugins/wp-slimbox2/

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,630 Times in 4,593 Posts
    Ahhh...sorry...but I'm not going to create a WordPress blog just to then install this to find out how it works.

    I did look at the "slimbox2.js" file, but of course the author has made the code as hard to read as possible, converting all variable names to single letters, etc., etc. Zero comments in the code, etc.

    Sorry, this is surely do-able, but the environment is just too unfriendly for me.

  • #5
    New Coder
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok, I am very flexible with whichever lightbox code to use. If anyone knows how to solve this challenging question please respond.

    Thank you.

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,630 Times in 4,593 Posts
    It may not be easy to just drop in any old lightbox. You probably have to use something the won't upset the existing WordPress code. No experience with WordPress, so I have no idea how true that might be.

    You know, you *could* try asking the author of that particular lightbox code. Who knows, he might be quite amenable to improving it to allow what you want, thus also making it more attractive to other users.


  •  

    Posting Permissions

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