hey, i got a image hosting script, and its all php, and i want to use lightbox with it since i got a section where members can view there uploaded pictures, but the thing is when i try <script type="text/javascript" src="lightbox.js"></script> it doesnt work, and when i try include() it just shows the .js code, any body knows how to do it within PHP??
lightbox is a client side javascript library, not a server side php library. You don't need to do anything with PHP to make it work.
where you are printing images, use rel="lightbox". and it will work. for instance <a href="yourbigimg.gif" rel="lightbox" title="Blah"><img src="yoursmallimg.gif" alt="Blah" class="thumbnails2" /></a>
Also include all js files right before <head> <script type="text/javascript" src="/templates/default/javascripts/prototype.js"></script> <script type="text/javascript" src="/templates/default/javascripts/scriptaculous.js?load=effects"></script> <script type="text/javascript" src="/templates/default/javascripts/lightbox.js"></script> Peace designcode
No I have implemented this thing on many projects, I am sure you are missing something, perhaps you are not including js files on right place. Gimme the demo url and then I can tell you exact problem.
the demo is running on my IP so i dunt want my ip to be on ouublic forums, and plus the script is all php, thier is no <head> tags in it either
You will need to include the lightbox.js within the <head> tags of your file. If you don't have these tags, I would start by adding them. You're page won't validate without <head> tags either.