SCRIPT CARROUSEL

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : SCRIPT CARROUSEL

par stopher » 15 avr. 2009, 15:59

Et bien là , c'est du CSS ..

Tu définis une taille à ton div , puis tu paramètres margin en auto , ce qui doit te donner un truc du style :
<div id="Carousel" style="position:relative;width=200px;margin-left:auto;margin-right:auto;"></div>
Là j'ai mis 200px , mais tu adaptes ..
Si tu ne specifies pas de taille , ton div va s'étendre au maximum , et donc ne pas se centrer ..

Ch.

par Invité » 15 avr. 2009, 15:46

oui il fonctionne mais le
<div id="Carousel" style="position:relative"></div> 
qui appel ma fonction & a gauche de ma page comment le centré il y a un truk de couches non?

par stopher » 15 avr. 2009, 13:18

Slt ..

Il manque un truc dans l'énoncé ..

... car jusqu'ici , on ne sait pas comment tu veux afficher le résultat de ton script ... :lol:

Et puis bon , franchement ... comment veux tu que l'on arrive à voir ce que tu souhaites , sachant , que tu nous donne du code à foison ( sans savoir s'il fonctionne ) , mais que nous sommes incapable de tester ..

Si c'est un probléme d'affichage ( que ton script fonctionne ) fais plutôt ta demande au niveau HTML, XHTML, CSS ...


S'il ne fonctionne pas , donne nous plus de détails ...

Ch.

SCRIPT CARROUSEL

par fouf1 » 15 avr. 2009, 02:14

Salut a tous
j'ai télécharger un script carrousel mais je n'arrive pas a le positionner dans la page comme je le voudrai
<?php
 header('Content-type: text/html; charset=iso-8859-1');
$idSalle=$_GET['idSalle'];
 include("connexion.php");   																		//*****Appel de la fonction connexion()*******// 
	$macnx=connexion();																					//*****Récuperation de l'identifiant de connexion*****//
	if ($macnx != 0)																							//*****Test si l'identifant de connexion est différent de 0*****//
	{
    //*************requete Meta**************
    $reqMeta = "SELECT* FROM metaproduit where prod_id=".$idSalle;
    $resMeta = mysql_db_query("espaceevenement", $reqMeta, $macnx) or die ("Echec". mysql_error ($macnx));
    $ligneMeta = mysql_fetch_array($resMeta);

    $titre=$ligneMeta['titre'];
    $metaDesc=$ligneMeta['metaDesc'];
    $metaKeyw=$ligneMeta['metaKeyw'];
    $metaSubj=$ligneMeta['metaSubj'];
  
		$requete = "SELECT * FROM produit where prod_id = '$idSalle'";
		$resultat = mysql_db_query("espaceevenement", $requete, $macnx) or die ("Echec". mysql_error ($macnx));								//*****Execution de la requete ($laBase, $laRequete, $laConnexion)*****//
		$ligne=mysql_fetch_array($resultat);	
		
		
		$requetePh = "SELECT * FROM photo where prod_id = '$idSalle'";
		$resultatPh = mysql_db_query("espaceevenement", $requetePh, $macnx) or die ("Echec". mysql_error ($macnx));
		
		
		$prod_nomSalle = $ligne['prod_nomsalle'];
		$text_salle = $ligne['text_salle'];
?>
<!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" xml:lang="en" lang="en" >
	<head>

  <title><?php echo $titre; ?></title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<meta name="Robots" content="index,follow,all" />
	<meta name="description" content="<?php echo $metaDesc; ?>" />
	<meta name="keywords" content="<?php echo $metaKeyw; ?>" />
	<meta name="subject" content="<?php echo $metaSubj; ?>" />

	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		
		<?php 
		include_once('PHPdiapo.php');
		$flash = 1;
		?>

   <SCRIPT type="text/javascript" title="G1SCRIPT">


// 7 variables to control behavior
	var Car_Image_Width=80;
	var Car_Image_Height=100;
	var Car_Border=true;		// true or false
	var Car_Border_Color="white";
	var Car_Speed=4;
	var Car_Direction=true;		// true or false
	var Car_NoOfSides=8;		// must be 4, 6, 8 or 12

/* array to specify images and optional links. 
	For 4 sided carousel specify at least 2 images
	For 6 sided carousel specify at least 3
	For 8 sided carousel specify at least 4
	For 12 sided carousel specify at least 6
 If Link is not needed keep it ""
*/
	Car_Image_Sources=new Array(
		"http://www.espaceevenement.com/photoEs/vignette/24_DSC01249.jpg","http://www.espaceevenement.com/photoEs/photo/24_DSC01249.JPG",
		"http://www.espaceevenement.com/photoEs/vignette/24_facade.jpg","http://www.espaceevenement.com/photoEs/photoe/24_facade.jpg",
		"http://www.espaceevenement.com/photoEs/vignette/24_niveau-1.jpg","http://www.espaceevenement.com/photoEs/photo/24_niveau-1.jpg", //this slide isn't linked
		"http://www.espaceevenement.com/photoEs/vignette/24_salle1.jpg","http://www.espaceevenement.com/photoEs/photo/24_salle1.jpg",
    "","http://www.boost-gsm.com/" // NOTE No comma after last line
		);

/***************** DO NOT EDIT BELOW **********************************/
	CW_I=new Array(Car_NoOfSides/2+1);C_ClcW=new Array(Car_NoOfSides/2);
	C_Coef=new Array(
		3*Math.PI/2,0,3*Math.PI/2,11*Math.PI/6,Math.PI/6,3*Math.PI/2,7*Math.PI/4,	0,
		Math.PI/4,3*Math.PI/2,5*Math.PI/3,11*Math.PI/6,0,Math.PI/6,Math.PI/3);
	var C_CoefOf=Car_NoOfSides==4?0:Car_NoOfSides==6?2:Car_NoOfSides==8?5:9;
	C_Pre_Img=new Array(Car_Image_Sources.length);
	var C_Angle=Car_Direction?Math.PI/(Car_NoOfSides/2):0,C_CrImg=Car_NoOfSides,C_MaxW,C_TotalW,
	C_Stppd=false,i,C_LeftOffset,C_HalfNo=Car_NoOfSides/2;

	function Carousel(){
		if(document.getElementById){
			for(i=0;i<Car_Image_Sources.length;i+=2){
				C_Pre_Img[i]=new Image();C_Pre_Img[i].src=Car_Image_Sources[i]}
			C_MaxW=Car_Image_Width/Math.sin(Math.PI/Car_NoOfSides)+C_HalfNo+1;
			Car_Div=document.getElementById("Carousel");
			for(i=0;i<C_HalfNo;i++){
				CW_I[i]=document.createElement("img");Car_Div.appendChild(CW_I[i]);	
				CW_I[i].style.position="absolute";
				CW_I[i].style.top=0+"px";
				CW_I[i].style.height=Car_Image_Height+"px";
				if(Car_Border){
					CW_I[i].style.borderStyle="solid";
					CW_I[i].style.borderWidth=1+"px";
					CW_I[i].style.borderColor=Car_Border_Color}
				CW_I[i].src=Car_Image_Sources[2*i];
				CW_I[i].lnk=Car_Image_Sources[2*i+1];
				CW_I[i].onclick=C_LdLnk;
				CW_I[i].onmouseover=C_Stp;
				CW_I[i].onmouseout=C_Rstrt}
			CarImages()}}

	function CarImages(){
		if(!C_Stppd){
			C_TotalW=0;
			for(i=0;i<C_HalfNo;i++){
				C_ClcW[i]=Math.round(Math.cos(Math.abs(C_Coef[C_CoefOf+i]+C_Angle))*Car_Image_Width);
				C_TotalW+=C_ClcW[i]}
			C_LeftOffset=(C_MaxW-C_TotalW)/2;
			for(i=0;i<C_HalfNo;i++){
				CW_I[i].style.left=C_LeftOffset+"px";
				CW_I[i].style.width=C_ClcW[i]+"px";
				C_LeftOffset+=C_ClcW[i]}
			C_Angle+=Car_Speed/720*Math.PI*(Car_Direction?-1:1);
			if((Car_Direction&&C_Angle<=0)||(!Car_Direction&&C_Angle>=Math.PI/C_HalfNo)){
				if(C_CrImg==Car_Image_Sources.length)C_CrImg=0;
				if(Car_Direction){
					CW_I[C_HalfNo]=CW_I[0];
					for(i=0;i<C_HalfNo;i++)CW_I[i]=CW_I[i+1];
					CW_I[C_HalfNo-1].src=Car_Image_Sources[C_CrImg];
					CW_I[C_HalfNo-1].lnk=Car_Image_Sources[C_CrImg+1]}
				else{	for(i=C_HalfNo;i>0;i--)CW_I[i]=CW_I[i-1];
					CW_I[0]=CW_I[C_HalfNo];
					CW_I[0].src=Car_Image_Sources[C_CrImg];
					CW_I[0].lnk=Car_Image_Sources[C_CrImg+1]}
				C_Angle=Car_Direction?Math.PI/C_HalfNo:0;C_CrImg+=2}}
		setTimeout("CarImages()",50)}

	function C_LdLnk(){if(this.lnk)window.location.href=this.lnk}
	function C_Stp(){this.style.cursor=this.lnk?"pointer":"default";C_Stppd=true;}
	function C_Rstrt(){C_Stppd=false}
</SCRIPT>
    
    
    
    
		<script language="JavaScript" type="text/javascript">
		function getStyle(el,styleProp)
			{
				var x = document.getElementById(el);
				if (window.getComputedStyle)
				var y = window.getComputedStyle(x,null).getPropertyValue(styleProp);
				else if (x.currentStyle)
				var y = eval('x.currentStyle.' + styleProp);
				return y;
			}
		function ajust_element()
			{
			var fin = 'fin';
				var elemtaille = getStyle(fin, 'height');
				var tempoimg = elemtaille;
				//alert(elemtaille);
				elemtaille =elemtaille.substring(0,3);
				//alert(elemtaille);
				var monEntier = parseInt(elemtaille);
				//elemtaille=elemtaille *1;
				//alert(elemtaille);
				monEntier = monEntier + 164;
				//alert(monEntier);
				document.getElementById('global').style.height = monEntier+'px';
				document.getElementById('listeimg').style.height = tempoimg;
				//alert('test');
			}
		function affichephoto(nomphoto)
			{
			document.getElementById('divvu').style.visibility = "visible";
			document.getElementById('vuimg').src = "photo/big/"+nomphoto+".jpg";
			
			}
		function fermevu()
			{
			document.getElementById('divvu').style.visibility = "hidden";
			}
		</script>
		
<style type="text/css">
a.link{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #edf1f4;
	text-decoration: none;
	font-weight: bold;
}
a.link:hover{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #ffffff;
	text-decoration: none;
	font-weight: bold;
	text-decoration:underline;
}
#divimg{
border:solid 1px #535353;
float:left;
width:60px;
height:60px;
}
</style>
</head>

<body style="margin:0;font-family:arial;color:#ffffff;background-color:#cfd3d6" onload="Carousel()">

<div id="divvu" style="position: absolute;top 200px;left:200px;visibility:hidden;" onclick="fermevu()"><img id="vuimg" src="" alt="espace evenement paris" /></div>

<div align="center">
	<div id="global" style="background-color:#000000;width:780px;margin-top:10px;" >
			<!-- logo -->
			<div style="float:left;background-image:url(../images/logo_black.jpg);background-repeat:no-repeat;width:170px;height:102px;">
			</div>
			<!-- banniere -->
			<div style="float:left;width:610px;height:102px;font-size:9pt;">
				<div style="float:right;text-align:right;font-size:9pt;margin-right:14px;width:200px;height:70px;">
				<br /><br /><br /><br />
  				Tel : +331.42.33.01.64<br />
				[email protected]<br />
				2, rue de Valois 75001 Paris<br />
				</div>
			</div>

			<!-- MENU -->
			<div style="float:left;background-color:#000000;width:778px;height:20px;text-align:left;color:#000000;font-size:9pt;border:solid 1px #000000;">
				<div style="float:left;width:100px;height:18;margin-top:2px;margin-left:3px;"></div>
				<div style="float:left;width:100px;height:18;margin-top:2px;"></div>
				<div style="float:left;width:100px;height:18;margin-top:2px;"></div>
				<div style="float:left;width:100px;height:18;margin-top:2px;"></div>
			</div>
			<div style="float:left;background-color:#000000;width:778px;height:20px;text-align:left;color:#ffffff;font-size:9pt;border:solid 1px #ffffff;">
				<div style="float:left;width:100px;height:18;margin-top:2px;margin-left:3px;"><a class="link" href="#">menu 1</a></div>
				<div style="float:left;width:100px;height:18;margin-top:2px;"><a class="link" href="">menu 2</a></div>
				<div style="float:left;width:100px;height:18;margin-top:2px;"><a class="link" href="#">menu 3</a></div>
				<div style="float:left;width:100px;height:18;margin-top:2px;"><a class="link" href="#">contact</a></div>
			</div>
		
			<div id="fin" style="float:left;width:780px">
      <br><br>
	<table>
			<tr>
				<td>
					<h1><?echo"$prod_nomSalle";?></h1>
				</td>
			</tr>
  </table>
  <table>
			<tr>
				<td valign="top">
					<div style="font-size:10pt;border:solid 1px #000000;">
						<?echo"$text_salle";?>
					</div>
				</td>
				<td>
					<table border="0">
						<tr>
							<td>
                <?//MON CAROUSEL ?>
                <div id="Carousel" style="position:relative"></div>
                <?

                    /*            
                  					echo '<div style="margin-top:5px;">';
                            // *** Placez cette partie ou le diaporama doit apparaitre
                            // repertoire de vos images (relatif a la page en cours)
                            $path="photoEs/vignette";
                            // id du diapo (sera utilisé pour le dom) sans caracteres speciaux
                            $iddiapo="espaceevenement1";
					 
                            $d=new PHPdiapo($path,$iddiapo);
                            echo '</div>';*/
								?>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			
			</table>
      <br><br>
			</div>
			<div><b style="float:left;height:20px;width:780px;font-size:10pt">lancement de produit - showroom - séminaire - présentation presse - exposition - dîner - cocktail - remise de prix</b></div>
			<!-- bas de page -->
			<div style="float:left;height:20px;width:780px;font-size:7pt;border-top:solid 1px #5f8eaa;">
				<div style="margin-top:5px;">Copyright © 2009 Espace Evénement</div>
			</div>
	</div>
</div>
<script language="JavaScript" type="text/javascript">
ajust_element();
</script>
</body>
</html>
<?
	}else{header("location:index.php?erreur=echecConnexion");}						//*****Redirection vers index.php passage parametre echecConnexion*****//
?>	

comment faire svp?