begin process at 2012 05 29 10:38:51
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Javascript / DHTML / Ajax

 > 

CSS

 > 

Général

 > 

mon diapo ne s'affiche pas sans connection


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

mon diapo ne s'affiche pas sans connection

mardi 21 juin 2011 à 09:44:52 | mon diapo ne s'affiche pas sans connection

hitu

Bonjour

j'ai réalisé un diaporama mais celui ne s'affiche pas quand je ne suis pas connecté!

Merci d'avance

voici mon code:

Code ActionScript :
[code=html]<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>

<!--script ascenseur texte-->

<script type="text/javascript">
var Timer=null;
var Pas = 3;
function moveLayer(Sens) {
	var Objet=document.getElementById("contenu");
    if(parseInt(Objet.style.top) + (Pas*Sens)>0)  {
		clearTimeout(Timer);
	}
	else if(parseInt(Objet.style.top) + (Pas*Sens)<-(Objet.offsetHeight-document.getElementById("support").offsetHeight)) {
		clearTimeout(Timer);
	}
    else {
        Objet.style.top = (parseInt(Objet.style.top) + (Pas*Sens)) + "px";
	}
	Timer = setTimeout("moveLayer(" + Sens + ");", 30);
}
</script>
</head>
<body onload="MM_preloadImages('images/imagegreve/images/1.jpg','images/imagegreve/images/essai6.jpg','images/imagegreve/images/essai7.jpg','images/imagegreve/images/essai.jpg','images/imagegreve/images/essai2.jpg','images/imagegreve/images/essai3.jpg','images/imagegreve/images/essai4.jpg','images/imagegreve/images/essai5.jpg','images/imagegreve/images/essai8.jpg','images/imagegreve/images/essai9.jpg','images/imagegreve/images/16.jpg')">

<div id="fond">
  <!--titre page-->
  <div id="titre">
  <h1>Le sacramentaire de Figeac</h1>
  </div>
  
  <!--texte-->
  <div id="texte">
  <p>Bibliothèque nationale de France, Manuscrit latin n°2293</p></br>
 <p>Extrait de l’ouvrage : la Préface commune et le Canon de la messe, folios 15v à 22 (sur un ensemble de 283 feuillets).</p>
</div>
  
<div id="source">
<p>Source gallica.BnF.fr</p>
</div>
  
<div id="realisation">
<p>Réalisation : Elodie Payrot</p>
</div>
  

	  <!-- diaporama -->
  
  
</div>
<div class="infobar"> <span id="description"></span> <span id="loading">Loading Image</span> <span class="reference"> </span> </div>
<div class="classe1" id="thumbsWrapper">
    <div id="content" >
   <img src="images/imagegreve/thumbs/1.jpg" alt="images/imagegreve/images/1.jpg" title="Reliure en maroquin rouge aux armes de Colbert, vers 1678"/>
    <img src="images/imagegreve/thumbs/essai6.jpg" alt="images/imagegreve/images/essai6.jpg" title=""/> <img src="images/imagegreve/thumbs/essai7.jpg" alt="images/imagegreve/images/essai7.jpg" title="Extrait de l’<i>ordo missae</i>"/>
    <img src="images/imagegreve/thumbs/essai.jpg" alt="images/imagegreve/images/essai.jpg" title="Titre du volume avec référence au pape Grégoire le Grand&nbsp;&nbsp;

&nbsp;&nbsp;
&nbsp;&nbsp;
&nbsp; Dialogue introductif de la Préface (<i>Per omnia secula seculorum</i>)"/>

    <img src="images/imagegreve/thumbs/essai2.jpg" alt="images/imagegreve/images/essai2.jpg" title="Préface commune de la messe (<i>Vere dignum et iustum est</i>)"/>
<img src="images/imagegreve/thumbs/essai3.jpg" alt="images/imagegreve/images/essai3.jpg" title="&nbsp;

&nbsp;&nbsp;
&nbsp;&nbsp;
&nbsp;&nbsp;
&nbsp;
&nbsp;Fin de la Préface et <i>Sanctus</i>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 Variante de la Préface pour les grandes fêtes liturgiques"/>

    <img src="images/imagegreve/thumbs/essai4.jpg" alt="images/imagegreve/images/essai4.jpg" title="Canon de la messe (<i>Te igitur clementissime Pater </i>)"/> 
    <img src="images/imagegreve/thumbs/essai5.jpg" alt="images/imagegreve/images/essai5.jpg" title="Canon de la messe"/>
  
    <img src="images/imagegreve/thumbs/essai8.jpg" alt="images/imagegreve/images/essai8.jpg" title="Fin du Canon &nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>ordo missae</i>"/>

    <img src="images/imagegreve/thumbs/essai9.jpg" alt="images/imagegreve/images/essai9.jpg" title=""/>
      <img src="images/imagegreve/thumbs/16.jpg" alt="images/imagegreve/images/16.jpg" title="Reliure en maroquin rouge aux armes de Colbert, vers 1678"/> 
      <div class="placeholder"></div>
    </div>
  </div>
  <div id="panel">
    <div id="wrapper">
      <div id="wrapper2"> <a id="prev"></a> <a id="next"></a></div>
    </div>
</div>
  <!-- The JavaScript -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
            $(function() {
                /* this is the index of the last clicked picture */
                var current = -1;
                /* number of pictures */
                var totalpictures = $('#content img').size();
                /* speed to animate the panel and the thumbs wrapper */
                var speed 	= 500;
				
                /* show the content */
                $('#content').show();
				
                /*
                when the user resizes the browser window,
                the size of the picture being viewed is recalculated;
                 */
                $(window).bind('resize', function() {
                    var $picture = $('#wrapper').find('img');
                    resize($picture);
                });
               
                /*
                when hovering a thumb, animate it's opacity
                for a cool effect;
                when clicking on it, we load the corresponding large image;
                the source of the large image is stored as 
                the "alt" attribute of the thumb image
                 */
                $('#content > img').hover(function () {
                    var $this   = $(this);
                    $this.stop().animate({'opacity':'1.0'},200);
                },function () {
                    var $this   = $(this);
                    $this.stop().animate({'opacity':'0.4'},200);
                }).bind('click',function(){
                    var $this   = $(this);
                    
                    /* shows the loading icon */
                    $('#loading').show();
                    
                    $('<img/>').load(function(){
                        $('#loading').hide();
                        
                        if($('#wrapper').find('img').length) return;
                        current 	= $this.index();
                        var $theImage   = $(this);
                        /*
                        After it's loaded we hide the loading icon
                        and resize the image, given the window size;
                        then we append the image to the wrapper
                        */
                        
                        resize($theImage);

                        $('#wrapper').append($theImage);
                        /* make its opacity animate */
                        $theImage.fadeIn(800);
                        
                        /* and finally slide up the panel */
                        $('#panel').animate({'height':'100%'},speed,function(){
                            /*
                            if the picture has a description,
                            it's stored in the title attribute of the thumb;
                            show it if it's not empty
                             */
                            var title = $this.attr('title');
                            if(title != '') 
                                $('#description').html(title).show();
                            else 
                                $('#description').empty().hide();
                            
                            /*
                            if our picture is the first one,
                            don't show the "previous button"
                            for the slideshow navigation;
                            if our picture is the last one,
                            don't show the "next button"
                            for the slideshow navigation
                             */
                            if(current==0)
                                $('#prev').hide();
                            else
                                $('#prev').fadeIn();
                            if(current==parseInt(totalpictures-1))
                                $('#next').hide();
                            else
                                $('#next').fadeIn();
                            /*
                            we set the z-index and height of the thumbs wrapper 
                            to 0, because we want to slide it up afterwards,
                            when the user clicks the large image
                             */
                            $('#thumbsWrapper').css({'z-index':'0','height':'0px'});
                        });
                    }).attr('src', $this.attr('alt'));
                });

                /*
                when hovering a large image,
                we want to slide up the thumbs wrapper again,
                and reset the panel (like it was initially);
                this includes removing the large image element
                 */
                $('#wrapper > img').live('click',function(){
                    $this = $(this);
                    $('#description').empty().hide();
                    
                    $('#thumbsWrapper').css('z-index','10')
                    .stop()
                    .animate({'height':'100%'},speed,function(){
                        var $theWrapper = $(this);
                        $('#panel').css('height','0px');
                        $theWrapper.css('z-index','0');
                        /* 
                        remove the large image element
                        and the navigation buttons
                         */
                        $this.remove();
                        $('#prev').hide();
                        $('#next').hide();
                    });
                });

                /*
                when we are viewing a large image,
                if we navigate to the right/left we need to know
                which image is the corresponding neighbour.
                we know the index of the current picture (current),
                so we can easily get to the neighbour:
                 */
                $('#next').bind('click',function(){
                    var $this           = $(this);
                    var $nextimage 		= $('#content img:nth-child('+parseInt(current+2)+')');
                    navigate($nextimage,'right');
                });
                $('#prev').bind('click',function(){
                    var $this           = $(this);
                    var $previmage 		= $('#content img:nth-child('+parseInt(current)+')');
                    navigate($previmage,'left');
                });

                /*
                given the next or previous image to show,
                and the direction, it loads a new image in the panel.
                 */
                function navigate($nextimage,dir){
                    /*
                    if we are at the end/beginning
                    then there's no next/previous
                     */
                    if(dir=='left' && current==0)
                        return;
                    if(dir=='right' && current==parseInt(totalpictures-1))
                        return;
                    $('#loading').show();
                    $('<img/>').load(function(){
                        var $theImage = $(this);
                        $('#loading').hide();
                        $('#description').empty().fadeOut();
                         
                        $('#wrapper img').stop().fadeOut(500,function(){
                            var $this = $(this);
							
                            $this.remove();
                            resize($theImage);
                            
                            $('#wrapper').append($theImage.show());
                            $theImage.stop().fadeIn(800);

                            var title = $nextimage.attr('title');
                            if(title != ''){
                                $('#description').html(title).show();
                            }
                            else
                                $('#description').empty().hide();

                            if(current==0)
                                $('#prev').hide();
                            else
                                $('#prev').show();
                            if(current==parseInt(totalpictures-1))
                                $('#next').hide();
                            else
                                $('#next').show();
                        });
                        /*
                        increase or decrease the current variable
                         */
                        if(dir=='right')
                            ++current;
                        else if(dir=='left')
                            --current;
                    }).attr('src', $nextimage.attr('alt'));
                }

                /*
                resizes an image given the window size,
                considering the margin values
                 */
                function resize($image){
                    var windowH      = $(window).height()-100;
                    var windowW      = $(window).width()-80;
                    var theImage     = new Image();
                    theImage.src     = $image.attr("src");
                    var imgwidth     = theImage.width;
                    var imgheight    = theImage.height;

                    if((imgwidth > windowW)||(imgheight > windowH)){
                        if(imgwidth > imgheight){
                            var newwidth = windowW;
                            var ratio = imgwidth / windowW;
                            var newheight = imgheight / ratio;
                            theImage.height = newheight;
                            theImage.width= newwidth;
                            if(newheight>windowH){
                                var newnewheight = windowH;
                                var newratio = newheight/windowH;
                                var newnewwidth =newwidth/newratio;
                                theImage.width = newnewwidth;
                                theImage.height= newnewheight;
                            }
                        }
                        else{
                            var newheight = windowH;
                            var ratio = imgheight / windowH;
                            var newwidth = imgwidth / ratio;
                            theImage.height = newheight;
                            theImage.width= newwidth;
                            if(newwidth>windowW){
                                var newnewwidth = windowW;
                                var newratio = newwidth/windowW;
                                var newnewheight =newheight/newratio;
                                theImage.height = newnewheight;
                                theImage.width= newnewwidth;
                            }
                        }
                    }
                    $image.css({'width':theImage.width+'px','height':theImage.height+'px'});
                }
            });
        </script>
       
 </div> 
</div>
</div>

</body>
</html>
[/code]
Code ActionScript :
dimanche 26 juin 2011 à 19:49:30 | Re : mon diapo ne s'affiche pas sans connection

mikeyjoy

Il y a un script Javascript qui est chargé sur une adresse distante :
Regarde la ligne
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">


Essaie de mettre ce fichier sur ton ordinateur (sans oublier de changer l'url de la source: src="monRepertoire/jquery.min.js"

et regarde si ca marche ^^


Cette discussion est classée dans : function, image, var, theimage, if


Répondre à ce message

Sujets en rapport avec ce message

Visionneuse d'images javascript avec liens et boutons [ par marcmebtouche ] Bonjour   Pourriez vous répondre  à un problème de programmation en javascript. J'ai crée pour Player multi format sécuriter java & php [ par c2bomb ] bonjour a tous,je cherche a afficher mon player,dans une fenetre style popup,mais hélas je suis vraiment nulle en javascript...si quelq'un peut m'aide Liste déroulante avec recherche par clavier [ par chahy ] Bonjour les amiesj'ai un petit probléme que je n'arrive pas a le resoudre , je veux que le resultat trouvez avec cette Liste déroulante avec recherche Une ame charitable pour arrander un script [ par balous001 ] bonjour a tous et a toutes !Je sollicite votre aide pour arranger un script defectueux.Je m'explique:Je vient de crée un forum chez l'hebergeur forum Problème pour appeler une fonction en javascript [ par Joke758 ] J'essaie d'appeler la fonction AM.PassportEncrypt.EncryptData("test1", null, "pwd", null) mais je ne sais pas pourquoi ça ne fait rien..voici ma sourc modification lightbox .... bouton close en haut a droite [ par petardier ] bonjour,je souhaite modifier une light box en mettant le bouton close en haut a gauche , plutot qu'en bas.Ainsi, quand une image est plus grande que l changer le sens d'un texte qui défile [ par anthony428 ] Bonjour à tous, je viens de plonger les mains dans un site dont je suis chargé de faire la refonte et je souhaiterais changer le sens du texte qui d Chargement ajax du contenu au clic sur marqueur Google Maps V3 [ par vince240986 ] Bonjour, Voilà plusieurs jours que je bloque sur la création d'une fonction. L'idée est la suivante, j'ai crée une appli avec une base de données et besoin d,aide sur un jeu en php [ par alfredo09 ] bonjours a tous je joue a un jeu en php world of stargate et je me sert d,un script pour planifier mes soldats. il faut 8 minutes pour crée 3 soldats


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,326 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales