PDA

View Full Version : Lightbox 2.04 - Opens like regular link



Fenris
01-11-2010, 07:16 PM
1) Script Title:
Lightbox 2.04

2) Script URL (on DD):
http://www.dynamicdrive.com - N/A - Couldnt find it :(

3) Describe problem:
Hiya :)

For some reason my Lightbox 2.04 just stopped working, all it does now is to direct the user to a new page. Not quite the userfriendly and niceness I was looking for.

I tried a few things, as Im pretty sure I didnt change anything on the server side, so thinking it must be relating to the IE 8. However unable to find any remedy to my problem, I sincerly hope that you guys can help me!

My page is www.amsvartnir.dk and galleri is located:
http://amsvartnir.dk/index.php?option=com_content&view=article&id=84:galleri&catid=38:tattovering&Itemid=62

I tried adding the imageLink.rel = imageLink.getAttribute('rel'); around line 203 in lightbox.js, no change. I tried removing all other CSS in head, no change. I checked the hrefs to make sure that they were still valid, no change.
I have currently reverted all changes done while troubleshooting, expect the adding line to lightbox.js.

I know Im missing some stupid little thing, I just dont have enough experience with this to spot it. Hope anyone of you guys can help me outthere and this is posted the right place!

Thanks in advance

jscheuer1
01-11-2010, 11:06 PM
Prototype (used by Lightbox) and MooTools (on the page as well, presumably for some other use) will not work together.

These (prototype.js and it's helper files, like builder, etc. as well as mootools.js and any helper files for it you may or may not be using) are script libraries that have tons of routines in them that are very useful to other scripts - if those other scripts are written to take advantage of these routines.

However, the two libraries are incompatible with each other.

If you are not really using MooTools on that page, just get rid of it for that page.

But if you are using MooTools, there is no known fix to get it to coexist with Prototype that I'm aware of. So you have to make some decisions and/or do some research. You could choose to only use one or the other. Many scripts that require Prototype have counterparts that use MooTools and visa versa. Or you could opt to use another library (like jQuery, or Dojo perhaps, there are yet others) that might have scripts written in/for it that would accomplish your aims.

Also, jQuery is unique (as far as I know) in that if you use it for one or more things and still want to include a script for one other library, it has a method by which that can be done.

But you are better off in all cases, if you want to use any script libraries, to pick one and then only use scripts (if they require a library at all) that require that one library. Otherwise you will be courting errors, and even if everything works OK, serving tons more code than you really have to.

There could also be other problems with your page in addition to that described above.

Fenris
01-12-2010, 08:16 AM
Hiya

Thank you for the quick response :)

I have absolutely no clue on what your talking about :) - at first I believed it to be posted wrong, however you do make a reference to lightbox at the top, so most be right.

All in all it sounds like I need to do some clean up of the things you mention below :)
- Altho funny why it would run previously and not now, without changes to the page.

jscheuer1
01-12-2010, 08:56 AM
It happened when you added MooTools to the page:


<script type="text/javascript" src="/media/system/js/mootools.js"></script>
<script type="text/javascript" src="/media/system/js/caption.js"></script>

Get rid of those two and Lightbox will work again.

Fenris
01-14-2010, 10:03 AM
John - You rock! :)