Foros del Web » Programando para Internet » Javascript » Frameworks JS »

por que un script me anula el otro

Estas en el tema de por que un script me anula el otro en el foro de Frameworks JS en Foros del Web. muy buenas el caso es que tengo 2 script que quiero insertar en la misma pagina, pero uno me anula el otro y viceversa según ...
  #1 (permalink)  
Antiguo 18/06/2012, 16:11
 
Fecha de Ingreso: junio-2012
Mensajes: 5
Antigüedad: 11 años, 10 meses
Puntos: 0
Pregunta por que un script me anula el otro

muy buenas el caso es que tengo 2 script que quiero insertar en la misma pagina, pero uno me anula el otro y viceversa según la posición en que los ponga, es un slider junto a un carrousel de imágenes, os dejo el código para que les hecheis un vistazo tal como esta lo que me funciona es el carrusel, gracias de antemano.


<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jFlow Plus v2</title>
<link href='http://fonts.googleapis.com/css?family=Rokkitt:700' rel='stylesheet' type='text/css'>
<link href="styles/slider.css" type="text/css" rel="stylesheet"/>
<link rel="stylesheet" href="css/reset.css" media="screen">
<link rel="stylesheet" href="css/style.css" media="screen">


<style type="text/css">

.image_carousel {
padding: 0px 0 0px 0px;
margin-left: -40px;
margin-top: 120px;

}
.image_carousel img {
border: 1px solid #ccc;
background-color: white;
padding: 5px;
margin: 7px;
display: block;
float: left;
-moz-border-radius:10px 0px 0px 10px;
-webkit-border-bottom-right-radius: 10px;
-webkit-border-top-right-radius: 10px;
-khtml-border-bottom-left-radius: 10px;
-khtml-border-top-left-radius: 10px;
}
.clearfix {
float: none;
clear: both;
}



</style>


<link href="styles/jflow.style.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="scripts/jflow.plus.min.js" type="text/javascript"></script>
<script type="text/javascript">

$(document).ready(function(){

$("#myController").jFlow({

controller: ".jFlowControl", // must be class, use . sign

slideWrapper : "#jFlowSlider", // must be id, use # sign

slides: "#mySlides", // the div where all your sliding divs are nested in

selectedWrapper: "jFlowSelected", // just pure text, no sign

effect: "flow", //this is the slide effect (rewind or flow)

width: "894px", // this is the width for the content-slider

height: "367px", // this is the height for the content-slider

duration: 400, // time in milliseconds to transition one slide

pause: 5000, //time between transitions

prev: ".jFlowPrev", // must be class, use . sign

next: ".jFlowNext", // must be class, use . sign

auto: true

});

});

</script>
</head>

<body>


<div id="sliderContainer">
<div id="mySlides">
<div id="slide1" class="slide"> <img src="images/jflow-sample-slide1.png" alt="Slide 1 jFlow Plus" />

</div>
<div id="slide2" class="slide"> <img src="images/jflow-sample-slide2.png" alt="Slide 2 jFlow Plus" />

</div>
<div id="slide3" class="slide"> <img src="images/jflow-sample-slide3.png" alt="Slide 3 jFlow Plus" />


</div>
<div id="myController">
<span class="jFlowControl"></span>
<span class="jFlowControl"></span>
<span class="jFlowControl"></span>

</div>
<div class="jFlowPrev"></div>
<div class="jFlowNext"></div>
</div>


<div class="image_carousel">
<div id="foo1">
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/1.jpg" alt="basketball" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/2.jpg" alt="beachtree" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/10.jpg" alt="cupcackes" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/5.jpg" alt="hangmat" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/6.jpg" alt="new york" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/11.jpg" alt="laundry" width="160" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small//3.jpg" alt="mom son" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/4.jpg" alt="picknick" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/8.jpg" alt="shoes" width="125" height="75" />
<img src="file:///C:/AppServ/www//menu2/albun/examples/images/small/7.jpg" alt="paris" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/9.jpg" alt="sunbading" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/12.jpg" alt="yellow couple" width="160" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small//14.jpg" alt="mom son" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/17.jpg" alt="picknick" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/15.jpg" alt="shoes" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/18.jpg" alt="paris" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/16.jpg" alt="sunbading" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/13.jpg" alt="yellow couple" width="160" height="75" />
</div>
<div class="clearfix"></div>
</div>

<script type="text/javascript" language="javascript" src="jquery.js"></script>
<script type="text/javascript" language="javascript" src="jquery.carouFredSel-5.6.1.js"></script>
<script type="text/javascript" language="javascript">
$(function() {

$('#foo1').carouFredSel({
width: '100%',
auto : {
items : 5,
duration : 15000,
easing : "linear",
pauseDuration : 0,
pauseOnHover : "immediate"
}
});


});
</script>

</body>
</html>
  #2 (permalink)  
Antiguo 18/06/2012, 17:30
Avatar de Pablo Ayala  
Fecha de Ingreso: septiembre-2005
Ubicación: Cancún, México
Mensajes: 231
Antigüedad: 18 años, 7 meses
Puntos: 28
Respuesta: por que un script me anula el otro

Estas llamando 2 veces a jquery...

saludos
__________________
Atentamente,

Pablo Ayala.
Si vas a responder algo en el foro que sea con amabilidad.
  #3 (permalink)  
Antiguo 19/06/2012, 11:10
 
Fecha de Ingreso: junio-2012
Mensajes: 5
Antigüedad: 11 años, 10 meses
Puntos: 0
Respuesta: por que un script me anula el otro

Hola, y como debería de colocar o cual seria la correpcion.

Un saludo
  #4 (permalink)  
Antiguo 20/06/2012, 16:06
Avatar de Pablo Ayala  
Fecha de Ingreso: septiembre-2005
Ubicación: Cancún, México
Mensajes: 231
Antigüedad: 18 años, 7 meses
Puntos: 28
Respuesta: por que un script me anula el otro

De aqui:
Código Javascript:
Ver original
  1. <script type="text/javascript" language="javascript" src="jquery.js"></script>
  2. <script type="text/javascript" language="javascript" src="jquery.carouFredSel-5.6.1.js"></script>
  3. <script type="text/javascript" language="javascript">

Elimina la linea que dice:
Código Javascript:
Ver original
  1. <script type="text/javascript" language="javascript" src="jquery.js"></script>

te recomiendo ordenar mas tu código...

saludos
__________________
Atentamente,

Pablo Ayala.
Si vas a responder algo en el foro que sea con amabilidad.
  #5 (permalink)  
Antiguo 21/06/2012, 03:34
 
Fecha de Ingreso: junio-2012
Mensajes: 5
Antigüedad: 11 años, 10 meses
Puntos: 0
Respuesta: por que un script me anula el otro

Muy buenas, acabo de hacer lo que me comentas y el carousel ya corre pero para ello he tenido que poner el script debajo del script del slider y entonces me copia el mismo margen que tiene el slider de ancho 894px cuando el carousel tiene un ancho de pantalla completa de 1365px, he intentado cambiar los script pero no me funcionan los 2 si los cambio a otras posiciones, alguna recomendación, de todas formas muchas gracias por solucionarme esl problema de los script, un saludo.
  #6 (permalink)  
Antiguo 21/06/2012, 09:01
Avatar de Pablo Ayala  
Fecha de Ingreso: septiembre-2005
Ubicación: Cancún, México
Mensajes: 231
Antigüedad: 18 años, 7 meses
Puntos: 28
Respuesta: por que un script me anula el otro

puedes poner tu nuevo codigo?
__________________
Atentamente,

Pablo Ayala.
Si vas a responder algo en el foro que sea con amabilidad.
  #7 (permalink)  
Antiguo 22/06/2012, 12:43
 
Fecha de Ingreso: junio-2012
Mensajes: 5
Antigüedad: 11 años, 10 meses
Puntos: 0
Respuesta: por que un script me anula el otro

de este modo lo tengo ahora......


<html>
<head>
<title>Perfil</title>

<link rel="stylesheet" href="css/styles.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="css/styless.css" type="text/css" charset="utf-8"/>



<link rel="stylesheet" href="css/reset.css" media="screen">
<link rel="stylesheet" href="css/style.css" media="screen">

<link href='http://fonts.googleapis.com/css?family=Rokkitt:700' rel='stylesheet' type='text/css'>
<link href="styles/slider.css" type="text/css" rel="stylesheet"/>

<link href="styles/jflow.style.css" type="text/css" rel="stylesheet"/>




<style type="text/css">

body {
background-image: url(../../../../../Users/usuario/Desktop/WEB/fondos.png);
}
.image_carousel {
padding: 0px 0 0px 0px;
margin-left: 0px;
margin-top: 9px;

}
.image_carousel img {
border: 1px solid #ccc;
background-color: white;
padding: 5px;
margin: 7px;
display: block;
float: left;
-moz-border-radius:10px 0px 0px 10px;
-webkit-border-bottom-right-radius: 10px;
-webkit-border-top-right-radius: 10px;
-khtml-border-bottom-left-radius: 10px;
-khtml-border-top-left-radius: 10px;
}
.clearfix {
float: none;
clear: both;
}



</style>





</head>
<body>



<div id="sliderContainer">
<div id="mySlides">
<div id="slide1" class="slide"> <img src="images/jflow-sample-slide1.png" alt="Slide 1 jFlow Plus" />

</div>
<div id="slide2" class="slide"> <img src="images/jflow-sample-slide2.png" alt="Slide 2 jFlow Plus" />

</div>
<div id="slide3" class="slide"> <img src="images/jflow-sample-slide3.png" alt="Slide 3 jFlow Plus" />


</div>
<div id="myController">
<span class="jFlowControl"></span>
<span class="jFlowControl"></span>
<span class="jFlowControl"></span>

</div>
<div class="jFlowPrev"></div>
<div class="jFlowNext"></div>
</div>



<div class="image_carousel">
<div id="foo1">
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/1.jpg" alt="basketball" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/2.jpg" alt="beachtree" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/10.jpg" alt="cupcackes" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/5.jpg" alt="hangmat" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/6.jpg" alt="new york" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/11.jpg" alt="laundry" width="160" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small//3.jpg" alt="mom son" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/4.jpg" alt="picknick" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/8.jpg" alt="shoes" width="125" height="75" />
<img src="file:///C:/AppServ/www/wuaku/menu2/albun/examples/images/small/7.jpg" alt="paris" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/9.jpg" alt="sunbading" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/12.jpg" alt="yellow couple" width="160" height="75" />
<img src="file:///C:/AppServ/www/wuaku/menu2/albun/examples/images/small//14.jpg" alt="mom son" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/17.jpg" alt="picknick" width="125" height="75" />
<img src="file:///C:/AppServ/www/wuaku/menu2/albun/examples/images/small/15.jpg" alt="shoes" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/18.jpg" alt="paris" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/16.jpg" alt="sunbading" width="125" height="75" />
<img src="file:///C:/AppServ/www/menu2/albun/examples/images/small/13.jpg" alt="yellow couple" width="160" height="75" />
</div>
<div class="clearfix"></div>
</div>



<div class="header"></div>
<ul id="nas">
<li class="home"><a href=""><span></span></a></li>

<div id="content">

<div class="navis" id="nav">
<div class="item user">
<img src="images/bg_user.png" alt="" width="199" height="199" class="circle"/>
<a href="#" class="icon"></a>
<h2>katy</h2>
<ul>
<li><a href="#">Mi Perfil</a></li>
</ul>
</div>



<!-- The JavaScript -->







<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="scripts/jflow.plus.min.js" type="text/javascript"></script>
<script type="text/javascript">

$(document).ready(function(myController){

$("#myController").jFlow({

controller: ".jFlowControl", // must be class, use . sign

slideWrapper : "#jFlowSlider", // must be id, use # sign

slides: "#mySlides", // the div where all your sliding divs are nested in

selectedWrapper: "jFlowSelected", // just pure text, no sign

effect: "flow", //this is the slide effect (rewind or flow)

width: "894px", // this is the width for the content-slider

height: "367px", // this is the height for the content-slider

duration: 400, // time in milliseconds to transition one slide

pause: 5000, //time between transitions

prev: ".jFlowPrev", // must be class, use . sign

next: ".jFlowNext", // must be class, use . sign

auto: true

});

});

</script>


<script type="text/javascript" language="javascript" src="jquery.carouFredSel-5.6.1.js"></script>
<script type="text/javascript" language="javascript">
$(function(foo1) {

$('#foo1').carouFredSel({
width: '100%',
auto : {
items : 5,
duration : 15000,
easing : "linear",
pauseDuration : 0,
pauseOnHover : "immediate"
}
});


});
</script>


</body>
</html>


Un saludo

Etiquetas: ajax, funcion, html, js, select
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:00.