Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Call lightbox with JavaScript event handler?
Old 01-29-2012, 11:14 AM Call lightbox with JavaScript event handler?
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
I want to call lightbox with a JavaScript OnClick event. How exactly is this done? The reason is that I want a whole clickable table row to be the object you click on to call the lightbox window.
To see the page I'm using this on follow this link:
http://fastngoodwebsites.com/victorian 3/lightbox_test.html
I'm doing this because you can't contain block elements inside an inline element. So I can't wrap the table row inside a simple lightbox anchor.

Thank you.
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
 
Register now for full access!
Old 01-29-2012, 11:52 AM Re: Call lightbox with JavaScript event handler?
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
I've never had success using JS events on table rows, either. I think this is because a <td> sits on top of the <tr>, so whenever you click on a row, you're actually clicking on the <td>.

Try putting your onclick on all the <td>s. It works for me, but isn't very efficient.
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 01-29-2012, 01:03 PM Re: Call lightbox with JavaScript event handler?
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
Physicsguy,
Please tell me the code for calling Lightbox with JavaScript if at all possible anywhere.
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
Old 01-29-2012, 03:04 PM Re: Call lightbox with JavaScript event handler?
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
You need to have the Lightbox script. I've never used it, but the instructions are pretty clear under the big 'How to use' heading

It entirely depends on what script you're using, and how you want it to be used.
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 01-29-2012, 04:28 PM Re: Call lightbox with JavaScript event handler?
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
Physicsguy,
It is not simple to me. I can link to Lightbox with the usual rel="lightbox" in the anchor tag, but I have searched the web and found only one reference to calling Lightbox with an event handler. I have tried it, but I can't make it work.
http://www.dynamicdrive.com/forums/s...ad.php?t=49048

matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
Old 02-02-2012, 07:17 AM Re: Call lightbox with JavaScript event handler?
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
Are you skipping step 1? It looks like you need some other frameworks. Scriptaculous and Prototype, as well as the lightbox script.
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 02-02-2012, 09:58 AM Re: Call lightbox with JavaScript event handler?
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
Physicsguy,
That might be it. The solution given to me, suggested by jscheuer1 from dynamic drive forums, was to switch to "Slimbox 2".

http://www.digitalia.be/software/slimbox2

and using this simple code on this page:

http://code.google.com/p/slimbox/wik...avascript_code

It worked well for me, and it was valid XHTML
He did advise me to upgrade my jquery version.

Code:
<script  type="text/javascript"  src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js">
So if I did omit the first step and your solution works, there are three ways to do it! (One more was suggested on Lightbox forums.)
Thank you.
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
Reply     « Reply to Call lightbox with JavaScript event handler?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.36332 seconds with 12 queries