I know there's a sticky posting regarding the issue I'm facing, but I do hope to get some help even though I'm pretty sure you've read about this hundreds of times.
Well, I have a page that needs to use both prototype and jquery frameworks, and without changing the jquery files. So, to make a long story short, is there a way to modify the prototype.js file so that it doesn't clash with jquery? If so, will I also need to modify all the .js files on my site that use the prototype framework?
well, I've been using a really-really-really lovely and cool balloon toolip for years, and it uses prototype. The problem is that one of my clients now wants some specific jquery functions (to allow the user to select an area from a picture and save that area to a file)... so I would prefer to use both frameworks so that I don't have to switch to a new balloon tooltip.
This will happen only on the page of the jquery image selection page, so I won't be running into any problems on my other pages... so I would prefer to go the hard way. Could I have your help?
Generally it would be a good idea to run jQuery in noConflict mode. So it should be possible for you to run both jQuery and prototype libraries with (mostly) no change
Example:
Code:
var jQ = jQuery.noConflict();
(function($) {
// move all of your jQuery code here. You will be able to use $ for all jQuery related methods here, but prototype won't work here
})(jQ);
// here you can use $ from prototype
I've never used jQuery in noConflict mode, so can't speak to how well that works. But I've always understood that using ONE library is the best approach.
jQuery does have a nice tooltip, by itself, and there is a jQuery plugin for balloon tooltips that is also very nice, and could probably do a balloon tooltip that is not too different from what you're currently using.
But if you insist on using both libraries, then devnull69's suggestion should work.
__________________ ^_^
If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
I still suggest it is worthwhile having a look at jquery alternative tooltips such as this one. If not, devnull69's code looks cool
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
Yes, I’d also pledge for a jQuery tooltip then. After all, styling is usually done with CSS so it should be no major issue to make it look exactly the same. jQuery’s “noConflict” mode should really only be the very last resort if you have no control over parts of the site or other scripts.
You don't even need to define a jQ variable because $ is just an alias for the jQuery variable in jQuery even when you don't use noconflict.
Code:
jQuery.noConflict();
(function($) {
// move all of your jQuery code here. You will be able to use $ for all jQuery related methods here, but prototype won't work here
})(jQuery);