admin管理员组文章数量:1426066
I am trying to make a jquery tool tip to open up a link in a mootools lightbox.
Can you please help me... Here is my Code:
Header
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ".dtd">
<html xmlns="">
<script language="javascript" type="text/javascript" src="js/bumpbox.js"></script>
<script src="js/sifr.js" type="text/javascript"></script>
<script src="js/sifr-config.js" type="text/javascript"></script>
<script src=".1.2/full/jquery.tools.min.js" type="text/javascript"/></script>
<script type="text/javascript">
//no conflict jquery
var $ = jQuery.noConflict();
//jquery stuff
</script>
<script language="javascript" type="text/javascript" src="js/mootools.js"></script>
<link rel="stylesheet" href="style.css" type="text/css" media="screen,projection" />
<head>
Now here is my body Code:
<p>Phasellus pulvinar lacinia sapien eu lacinia. Sed fermentum augue et lectus ullamcorper quis cursus justo venenatis. Aenean id molestie leo. Vivamus ultrices lobortis velit, quis euismod neque aliquet quis. Aliquam et nisi nibh. Ut dolor dui, volutpat id molestie ut, tristique ut tellus. Nunc ut risus sed magna dictum porttitor.</p>
<!-- trigger element. a regular workable link -->
<div id="webdude">
<a id="laurence" title="asdadasd">asdadasd</a> <!-- tooltip element -->
<div class="tooltip" id="small">
<div><span class="name">asdadasd</span><br />
asdadasd <span><a href="^myDIV" class="bumpbox" rel="480-480" title="inline Content">[+]</a></span></div>
</div>
</div>
</div>
<div id="myDIV">
<div class="clear"></div>
<span>Inline content</span>
<p>This is some inline content which is <span class="style1">hidden onload, and then displayed in the bumpbox accordingly</span></p>
<p>Simply give your inline content an ID, fill it with content. Reference the hidden content by using the bumpbox, assigning the href tag with a "^". </p>
<p>For example, this content's DIV ID is "myDIV" and the bumpbox link href has the content href="^myDIV". That's it.</p>
</div>
Here is my footer:
<script>
// What is $(document).ready ? See: .html#document_ready
$(document).ready(function() {
// enable tooltip for "download" element. use the "slide" effect
$("#laurence").tooltip({
effect: 'slide',
offset: [60, 40] });
});
</script>
I am trying to make a jquery tool tip to open up a link in a mootools lightbox.
Can you please help me... Here is my Code:
Header
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3/1999/xhtml">
<script language="javascript" type="text/javascript" src="js/bumpbox.js"></script>
<script src="js/sifr.js" type="text/javascript"></script>
<script src="js/sifr-config.js" type="text/javascript"></script>
<script src="http://cdn.jquerytools/1.1.2/full/jquery.tools.min.js" type="text/javascript"/></script>
<script type="text/javascript">
//no conflict jquery
var $ = jQuery.noConflict();
//jquery stuff
</script>
<script language="javascript" type="text/javascript" src="js/mootools.js"></script>
<link rel="stylesheet" href="style.css" type="text/css" media="screen,projection" />
<head>
Now here is my body Code:
<p>Phasellus pulvinar lacinia sapien eu lacinia. Sed fermentum augue et lectus ullamcorper quis cursus justo venenatis. Aenean id molestie leo. Vivamus ultrices lobortis velit, quis euismod neque aliquet quis. Aliquam et nisi nibh. Ut dolor dui, volutpat id molestie ut, tristique ut tellus. Nunc ut risus sed magna dictum porttitor.</p>
<!-- trigger element. a regular workable link -->
<div id="webdude">
<a id="laurence" title="asdadasd">asdadasd</a> <!-- tooltip element -->
<div class="tooltip" id="small">
<div><span class="name">asdadasd</span><br />
asdadasd <span><a href="^myDIV" class="bumpbox" rel="480-480" title="inline Content">[+]</a></span></div>
</div>
</div>
</div>
<div id="myDIV">
<div class="clear"></div>
<span>Inline content</span>
<p>This is some inline content which is <span class="style1">hidden onload, and then displayed in the bumpbox accordingly</span></p>
<p>Simply give your inline content an ID, fill it with content. Reference the hidden content by using the bumpbox, assigning the href tag with a "^". </p>
<p>For example, this content's DIV ID is "myDIV" and the bumpbox link href has the content href="^myDIV". That's it.</p>
</div>
Here is my footer:
<script>
// What is $(document).ready ? See: http://flowplayer/tools/using.html#document_ready
$(document).ready(function() {
// enable tooltip for "download" element. use the "slide" effect
$("#laurence").tooltip({
effect: 'slide',
offset: [60, 40] });
});
</script>
Share
Improve this question
edited May 12, 2014 at 11:18
Dairo
8181 gold badge9 silver badges24 bronze badges
asked Apr 26, 2010 at 13:43
kwek-kwekkwek-kwek
1,3433 gold badges19 silver badges35 bronze badges
1
- 3 Both of these frameworks have both of these plugins, why not stick with a single framework? That's a lot of extra script for your client to run without much payoff. – Nick Craver Commented Apr 26, 2010 at 13:57
2 Answers
Reset to default 5you ruin the noConflict
concept by reassigning the jquery to the $
var ..
use jQuery.noConflict();
without assigning to a variable, and after that use jQuery
instead of $
so change
<script type="text/javascript">
//no conflict jquery
var $ = jQuery.noConflict();
//jquery stuff
</script>
to
<script type="text/javascript">
//no conflict jquery
jQuery.noConflict();
//jquery stuff
</script>
and
$(document).ready(function() {
// enable tooltip for "download" element. use the "slide" effect
$("#laurence").tooltip({
effect: 'slide',
offset: [60, 40] });
});
to
jQuery(document).ready(function() {
// enable tooltip for "download" element. use the "slide" effect
jQuery("#laurence").tooltip({
effect: 'slide',
offset: [60, 40] });
});
If you wrap the jQuery like this, you wont have change your code. The $ scope will bee isolated from the rest of the code and wont cause any conflict with other js framework.
(jQuery.noConflict())(function($) {
// enable tooltip for "download" element. use the "slide" effect
$("#laurence").tooltip({
effect: 'slide',
offset: [60, 40]
});
本文标签: javascriptJquery Tools and MooTools ConflictStack Overflow
版权声明:本文标题:javascript - Jquery Tools and MooTools Conflict - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745411971a2657511.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论