noconflict при jquery и prototype

  • Автор Автор Zion
  • Начална дата Начална дата

Zion

Registered
Здравейте, изникна ми един проблем. Немога да издокарам два JS скрипта да работят едновременно. Четох по чужди сайтове доста за тях но немога да се справя. Става дума за следните jQuery - http://code.drewwilson.com/entry/tiptip-jquery-plugin и prototype - http://lokeshdhakar.com/projects/lightbox2/

Ако може да помогнете ще съм ви много благодарен :)
 
По-добре ползвай само едната библиотека ;) Има толкова много лайтбокси на jquery ,че чак главата да те заболи :)
 
пробвах с jquery lightbox - http://leandrovieira.com/projects/jquery/lightbox/ но пак са несъвместими :X Побърках се с тея javascriptove
 
този лайтбокс http://leandrovieira.com/projects/jquery/lightbox/ със този тултип http://code.drewwilson.com/entry/tiptip-jquery-plugin
 
интересно и двете са на jqyery. Направи го някаде и дай линк да го видим
 
http://web-tourist.net/userfiles/4/4127.zip

Направил съм ги и двата скрипта на един индекс без други работи да не пречат :)
 
Така , проблема ти не идва от никакъв prototype с jquery , а идва от това ,че ползваш различни версии на jquery. Попрепрваих ти кода малко и всичко си работи, като скриптовете са долу вече.

HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>jQuery lightBox and tipTip</title>
    <link rel="stylesheet" type="text/css" href="scripts/css/tipTip/tipTip.css" media="screen" />
    <link rel="stylesheet" type="text/css" href="scripts/css/lightbox/jquery.lightbox-0.5.css" media="screen" />
    <script type="text/javascript" src="scripts/js/lightbox/jquery.js"></script>
</head>
<body>
<div id="gallery">
	<a href="photos/image1.jpg" rel="lightbox" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery').lightBox();">
		<img src="photos/thumb_image1.jpg" width="72" height="72" alt="" />
	</a>
	
	<a href="photos/image2.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery a').lightBox();">
		<img src="photos/thumb_image2.jpg" width="72" height="72" alt="" />
	</a>
	
	<a href="photos/image3.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery a').lightBox();">
		<img src="photos/thumb_image3.jpg" width="72" height="72" alt="" />
	</a>
	
	<a href="photos/image4.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery a').lightBox();">
		<img src="photos/thumb_image4.jpg" width="72" height="72" alt="" />
	</a>
	
	<a href="photos/image5.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery a').lightBox();">
		<img src="photos/thumb_image5.jpg" width="72" height="72" alt="" />
	</a>

</div>
<form method="" action="">
	<input type="text" name="text" class="tip" title="TipTip NE BACHKA" />
</form>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="scripts/js/lightbox/jquery.lightbox-0.5.js"></script>
<script src="scripts/js/tipTip/jquery.tipTip.js" type="text/javascript"></script>
<script type="text/javascript">
	(function(){ 
		$('.tip').tipTip({ defaultPosition: 'right' }); 
	})();
</script>
<script type="text/javascript">
		$(function() {
		// Use this example, or...
		$('a[rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
		// This, or...
		$('#gallery a').lightBox(); // Select all links in object with gallery ID
		// This, or...
		$('a.lightbox').lightBox(); // Select all links with lightbox class
		// This, or...
		$('a').lightBox(); // Select all links in the page
		// ... The possibility are many. Use your creative or choose one in the examples above
		});
	 </script>   
</body>
</html>
 
Значи прототайп проблема беше когато ползвах другия лайтбокс, нали ми казахте да го сменя със jQuery лайтбокс и сега проблема беше друг. В момента нямам възмойност да го пробвам, благодаря ти. Ще пиша пак ако има проблеми ! :)
 

Back
Горе