How can I make my site, play nice with jQuery and Prototype?
I've got a fairly large codebase to work with, and I'm attempting to use a prototype based script. The problem is, I've already got jQuery running, and it's fairly deeply entrenched in the codebase with the $('') functions being used. I'm aware of jQuery's no conflict mode, but开发者_运维百科 it's difficult for me to go back and change all of the code now. Is there an equivalent of no conflict mode for prototype? Failing that, is there an automatic find and replace to replace all of the $() functions to jQuery()?
As a better solution, if anyone knows of a jQuery based Lightwindow replacement, I'd be MUCH more grateful. My needs for it are fairly simple, but I've never been able to find one that works right for me. I just want it to work with swf objects, and photos, and not need anchor tags to work. The thing about lightwindow that I like, is I can just do a simple functions like below, to have it work.
$lightbox = "
myLightWindow.activateWindow({
href: \"{$this->swfURL}\",
title: \"{$this->src->mediaTitle}\",
width: $this->width,
height: $this->height
});";
return $lightbox;
I tried using http://planetozh.com/projects/lightbox-clones/ to find a replacement, but it seems to be out of date, and the only one that looked promising was CeeBox, but it was causing all kinds of errors and I believe it is because it's intended for an older version of jQuery.
Well anyways, thanks in advance for any help.
if you want a jquery lightbox clone, check out prettyPhoto. i've used it in a few projects and it is very easy and extensible. he's also got a few other plugins you should probably look at for modern development, like prettyLoader.
精彩评论