IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

jQuery Discussion :

Animation avec scrollIntoView


Sujet :

jQuery

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Inscrit en
    Février 2009
    Messages
    635
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 635
    Par défaut Animation avec scrollIntoView
    Bonjour,

    savez-vous s'il est possible d'ajouter une animation lors de la sélection d'un d'un scroll, j'ai regardé plusieurs exemple mais suis un peu perdu là...

    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    <!DOCTYPE html>
    <html>
    <head>
    <title>Exemple de scrollIntoView()</title>
     
    <script>
    function showIt(elID) {
        var el = document.getElementById(elID);
        el.scrollIntoView(true).scrollTop(300);
    }
    </script>
     
    </head>
    <body>
      <div style="height: 80px; width: 30em; overflow: scroll;
                  border: 1px solid blue;">
     
                 <table>
     
                 <tr>
        <td id="pToShow">Le paragraphe à afficher</td>
                 </tr>
                 <tr>
        <td id="pToShow2">Le paragraphe à afficher</td>
                 </tr>
                 <tr>
        <td id="pToShow3">Le paragraphe à afficher</td>
                 </tr>
                 <tr>
        <td id="pToShow4"><p>Le paragraphe à afficher</p></td>
                 </tr>
                 <tr>
        <td id="pToShow5">5 c'est le bon !</td>
                 </tr>
                 <tr>
        <td id="pToShow6">Le paragraphe à afficher</td>
                 </tr>
                 <tr>
        <td id="pToShow7">Le paragraphe à afficher</td>
                 </tr>
                 <tr>
        <td id="pToShow8">Le paragraphe à afficher</td>
                 </tr>
                 <tr>
        <td id="pToShow9">Le paragraphe à afficher</td>
                 </tr>
                 <tr>
        <td id="pToShow10">Le paragraphe à afficher</td>
                 </tr>
     
     
                 </table>
      </div>
      <input type="button" value="Afficher le paragraphe"
       onclick="showIt('pToShow5');">
    </body>
    </html>

  2. #2
    Rédacteur

    Avatar de danielhagnoul
    Homme Profil pro
    Étudiant perpétuel
    Inscrit en
    Février 2009
    Messages
    6 389
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant perpétuel
    Secteur : Enseignement

    Informations forums :
    Inscription : Février 2009
    Messages : 6 389
    Billets dans le blog
    125
    Par défaut
    Bonsoir

    Pour avoir une animation, il y a un plugin jQuery : https://github.com/litera/jquery-scrollintoview

    Blog

    Sans l'analyse et la conception, la programmation est l'art d'ajouter des bogues à un fichier texte vide.
    (Louis Srygley : Without requirements or design, programming is the art of adding bugs to an empty text file.)

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Afficher un Gif animée avec VC6
    Par vanitom dans le forum MFC
    Réponses: 2
    Dernier message: 13/10/2005, 17h46
  2. [FLASH MX2004] Lancer une anim avec des paramètres ??
    Par gchanteux dans le forum Flash
    Réponses: 4
    Dernier message: 23/03/2005, 17h49
  3. particules animées avec point sprites ?
    Par ilimo dans le forum DirectX
    Réponses: 3
    Dernier message: 10/09/2004, 23h12
  4. Animations avec différents objet
    Par Mathieu.J dans le forum OpenGL
    Réponses: 6
    Dernier message: 09/06/2004, 14h18
  5. Réponses: 2
    Dernier message: 14/01/2004, 16h21

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo