Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Ricardo_Carvalho

[Resolvido] Conflito .js

Recommended Posts

Oi!

Quero add uma .js (colorbox)

Mas quando add ela... a que eu ja tinha antes (accordian) para de funcionar... e vice-versa

 

 

Atual

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<META NAME="author" CONTENT="VIP Propaganda">
		<meta name="description" content="VIP - Agencia de publicidade focada no conceito de comunicacao total, planejamento de marketing focado em resultados reais."/>
		<META NAME="keywords" CONTENT="Agencia de publicidade focada no conceito de comunicacao total, planejamento de marketing focado em resultados reais">
		<meta name="URL" content="http://www.vippropaganda.com.br" />
		<meta name="language" content="portuguese" />
		<meta name="robots" content="INDEX, FOLLOW" / >
		<meta http-equiv="Content-Language" content="PT-BR" / >
		<title>VIP Propaganda e Marketing</title>
		<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
		<script type="text/javascript" src="js/accordian.js"></script>
		</head>

 

Quero adicionar

 

	
		<link media="screen" rel="stylesheet" href="css/colorbox.css" />
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
		<script src="js/jquery.colorbox.js"></script>
		<script>
			$(document).ready(function(){
				//Examples of how to assign the ColorBox event to elements
				$("a[rel='example1']").colorbox();
				$(".example9").colorbox({
					onOpen:function(){ alert('onOpen: colorbox is about to open'); },
					onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
					onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
					onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
					onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
				});
				
				//Example of preserving a JavaScript event for inline calls.
				$("#click").click(function(){ 
					$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
					return false;
				});
			});
		</script>

Tentei usar o noConflict mas acho que estou fazendo alguma coisa errada... por que continua na mesma =/

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<META NAME="author" CONTENT="VIP Propaganda">
		<meta name="description" content="VIP - Agencia de publicidade focada no conceito de comunicacao total, planejamento de marketing focado em resultados reais."/>
		<META NAME="keywords" CONTENT="Agencia de publicidade focada no conceito de comunicacao total, planejamento de marketing focado em resultados reais">
		<meta name="URL" content="http://www.vippropaganda.com.br" />
		<meta name="language" content="portuguese" />
		<meta name="robots" content="INDEX, FOLLOW" / >
		<meta http-equiv="Content-Language" content="PT-BR" / >
		<title>VIP Propaganda e Marketing</title>
		<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
		<script type="text/javascript" src="js/accordian.js"></script>
	<script type="text/javascript">
var j = jQuery.noConflict();

j(function() {
j("div#slider").accordian({
timeOut: 4000
});
});
</script>
		<link media="screen" rel="stylesheet" href="css/colorbox.css" />
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
		<script src="js/jquery.colorbox.js"></script>
		<script>
			$(document).ready(function(){
				//Examples of how to assign the ColorBox event to elements
				$("a[rel='example1']").colorbox();
				$(".example9").colorbox({
					onOpen:function(){ alert('onOpen: colorbox is about to open'); },
					onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
					onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
					onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
					onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
				});
				
				//Example of preserving a JavaScript event for inline calls.
				$("#click").click(function(){ 
					$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
					return false;
				});
			});
		</script>
		</head>

Valeu

Compartilhar este post


Link para o post
Compartilhar em outros sites

Consegui!

 

E ficou assim:

 

<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
		<script type="text/javascript" src="js/accordian.js"></script>
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
		<script src="js/jquery.colorbox.js"></script>
		<script type="text/javascript">
  $.noConflict();
  jQuery(document).ready(function($) {		
				jQuery("a[rel='example1']").colorbox();
				});
				$("#click").click(function(){ 
					$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
					return false;
				});
		</script>

 

 

Pode fechar o topico (:

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.