Standalone mode versus using with external javaScript library

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Standalone mode versus using with external javaScript library

mrbabyqc
Hi mjijackson,

Very exciting job ! I use the first version of shadowbox on my blog. Since the version 2.0rc1 give us the ability to implement shadowbox in standalone mode, can you tell us what can be the benefit to use it in conjunction with any open source JavaScript framework (like prototype, mootools, etc) ? In term of load time, functionality ?

TIA
Reply | Threaded
Open this post in threaded view
|

Re: Standalone mode versus using with external javaScript library

Wizzud
This depends on what else you currently use - or intend to use - on your page.
Javascript libraries are there to make using javascript simpler (sometimes they do, sometimes they don't!).
If your page already uses a library, and that library is supported by a Shadowbox adaptor, then you might as well use library+adaptor because the adaptor is (slightly) smaller than base.
If you don't currently use any library on your page (or it's a library for which Shadowbox does not provide an adaptor,eg APE), or you don't need any fancy javascript effects beyond Shadowbox, then use the base because it's smaller than a full library and specifically tailored to provide only the functionality required by Shadowbox.
Combine literacy with curiosity and a whole world of information opens up to you
Reply | Threaded
Open this post in threaded view
|

Re: Standalone mode versus using with external javaScript library

mrbabyqc
Thank a lot Wizzud for your answer in plain text ! I asked the question because I used to use shadowbox in my wordpress based site http://bbeko.qc.to/. Wordpress already make intensive use of different javascript libraries (mainly prototype and jquery) depending of the core file loaded. Then I want to avoid loading the same library twice and I dont know how to prevent that. Since I want to have shadowbox mimic available everywhere in the site, I think that I'm better load it from my header.php (wich is loaded always by most of the page) file in standalone mode.

Maybe is there some one here who can learn me (by code) how to check if a given library have been loaded before trying to load it once more ?