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

JavaScript Discussion :

Numérotation style Badoo


Sujet :

JavaScript

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Février 2010
    Messages
    45
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2010
    Messages : 45
    Points : 45
    Points
    45
    Par défaut Numérotation style Badoo
    Bonjour,

    Je m'explique : j'aimerais faire apparaitre un nombre qui évoluera en direct et j'aimerais le faire apparaitre de la même façon que sur la page d'accueil de badoo.com

    Avez-vous des idées pour réaliser ce genre de chose ?

    Merci à vous !

  2. #2
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    17 075
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 075
    Points : 44 657
    Points
    44 657
    Par défaut
    Bonjour,
    il s'agit visiblement d'une animation sur base de rotation d'images.

  3. #3
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Points : 15 059
    Points
    15 059
    Par défaut
    Bonsoir,

    C'est un site à la Facebook
    Ok, pour être sérieux; tu lances une requête ajax à chaque intervalle de temps (une fonction récursive avec un setTimeout ou seulement un setInterval), du coté serveur, tu faits seulement une requête
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    select count(*) from NomTableUser
    et envoyer le résultat vers la page. Pour le style, tu utilises des images à la place de chaque chiffre. Recherche sur le forum AJAX, des discussions proches sont résolue.

    A+.

  4. #4
    Invité
    Invité(e)
    Par défaut
    apres analyse il s'agit d'un background pour lequel on modifie sa position en jouant sur les class une prise de tete a faire il doit y avoir environ 3*10 ce qui donne 30 class car a chaque changement de chiffre on joue sur 3 class

  5. #5
    Membre du Club
    Profil pro
    Inscrit en
    Février 2010
    Messages
    45
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2010
    Messages : 45
    Points : 45
    Points
    45
    Par défaut
    Merci pour vos réponse !

    Premièrement, ce n'est pas la récupération du nombre dans la BD en Ajax qui me pose problème, de ce côté pas de soucis, mais merci quand même andry !

    NoSmoking, tu parles de rotation d'image, ce serai donc un effet JS qui gérerait l'animation ? J'aimerai bien que tu m'en dises plus !

    Mekal, je ne suis pas bien sur de te suivre, en gros tu penses que pour chaque changement de chiffre, c'est une animation image par image au niveau de background ?

    Merci !

  6. #6
    Invité
    Invité(e)
    Par défaut
    j'ai regarder avec firebug et a chaque changement de chiffre on voit la class se modifier et j'ai meme intercepter l'image qui contient toutes les animations

    http://images.badoo.com/2846/-/-/css...ter_people.png

  7. #7
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    17 075
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 075
    Points : 44 657
    Points
    44 657
    Par défaut
    j'ai regarder avec firebug et a chaque changement de chiffre on voit la class se modifier et j'ai meme intercepter l'image qui contient toutes les animations
    effectivement, en jouant sur le changement de la position du background

    action
    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
    58
    59
    60
    61
    62
    63
    64
    65
    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>[Modif position background...]</title>
    <style type="text/css">
    .mp_cnt{background-color:#fff;white-space:nowrap;}
    .mp_cnt_d{position:relative;display:inline-block;width:40px;height:58px;background:url(http://images.badoo.com/2846/-/-/i/counter_people.png) no-repeat 0 0;}
    .mp_cnt_dot,.mp_cnt_comma{width:7px;height:7px;overflow:hidden;margin:51px 1px 0 0;}
    .mp_cnt_d_f{position:absolute;top:100%;left:0;width:40px;height:12px;background:url(http://images.badoo.com/2846/-/-/i/counter_people.png) no-repeat -80px -580px;}
    .mp_cnt_d_0{background-position:0 0;}
    .mp_cnt_d_0_1{background-position:-40px 0;}
    .mp_cnt_d_0_2{background-position:-80px 0;}
    .mp_cnt_d_1{background-position:0 -58px;}
    .mp_cnt_d_1_1{background-position:-40px -58px;}
    .mp_cnt_d_1_2{background-position:-80px -58px;}
    .mp_cnt_d_2{background-position:0 -116px;}
    .mp_cnt_d_2_1{background-position:-40px -116px;}
    .mp_cnt_d_2_2{background-position:-80px -116px;}
    .mp_cnt_d_3{background-position:0 -174px;}
    .mp_cnt_d_3_1{background-position:-40px -174px;}
    .mp_cnt_d_3_2{background-position:-80px -174px;}
    .mp_cnt_d_4{background-position:0 -232px;}
    .mp_cnt_d_4_1{background-position:-40px -232px;}
    .mp_cnt_d_4_2{background-position:-80px -232px;}
    .mp_cnt_d_5{background-position:0 -290px;}
    .mp_cnt_d_5_1{background-position:-40px -290px;}
    .mp_cnt_d_5_2{background-position:-80px -290px;}
    .mp_cnt_d_6{background-position:0 -348px;}
    .mp_cnt_d_6_1{background-position:-40px -348px;}
    .mp_cnt_d_6_2{background-position:-80px -348px;}
    .mp_cnt_d_7{background-position:0 -406px;}
    .mp_cnt_d_7_1{background-position:-40px -406px;}
    .mp_cnt_d_7_2{background-position:-80px -406px;}
    .mp_cnt_d_8{background-position:0 -464px;}
    .mp_cnt_d_8_1{background-position:-40px -464px;}
    .mp_cnt_d_8_2{background-position:-80px -464px;}
    .mp_cnt_d_9{background-position:0 -522px;}
    .mp_cnt_d_9_1{background-position:-40px -522px;}
    .mp_cnt_d_9_2{background-position:-80px -522px;}
    .mp_cnt_dot{background-position:-32px -631px;}
    .mp_cnt_comma{background-position:-73px -631px;}
    </style>
    </head>
    <body>
    <div id="counter" class="mp_cnt mp_t">
    <span class="mp_cnt_d mp_cnt_d_1"></span>
    <span class="mp_cnt_d mp_cnt_d_1_1"></span>
    <span class="mp_cnt_d mp_cnt_d_1_2"></span>
    <span class="mp_cnt_d mp_cnt_d_2"></span>
    <span class="mp_cnt_d mp_cnt_d_2_1"></span>
    <span class="mp_cnt_d mp_cnt_d_2_2"></span>
    <span class="mp_cnt_d mp_cnt_d_3"></span>
    <span class="mp_cnt_d mp_cnt_d_3_1"></span>
    <span class="mp_cnt_d mp_cnt_d_3_2"></span>
    <span class="mp_cnt_d mp_cnt_d_4"></span>
    <span class="mp_cnt_d mp_cnt_d_4_1"></span>
    <span class="mp_cnt_d mp_cnt_d_4_2"></span>
    <span class="mp_cnt_d mp_cnt_d_5"></span>
    <span class="mp_cnt_d mp_cnt_d_5_1"></span>
    <span class="mp_cnt_d mp_cnt_d_5_2"></span>
    <span class="mp_cnt_d mp_cnt_d_6"></span>etc...
    </div>
    </body>
    </html>

  8. #8
    Membre du Club
    Profil pro
    Inscrit en
    Février 2010
    Messages
    45
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2010
    Messages : 45
    Points : 45
    Points
    45
    Par défaut
    Merci bien à vous deux !

    Tout est très clair maintenant pour moi !

    Encore une fois, merci beaucoup d'avoir pris du temps pour moi !

  9. #9
    Membre du Club
    Profil pro
    Inscrit en
    Février 2010
    Messages
    45
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2010
    Messages : 45
    Points : 45
    Points
    45
    Par défaut
    Oups, j'avais oublié le thread comme résolu, c'est corrigé !

    Merci encore !!

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

Discussions similaires

  1. Réponses: 2
    Dernier message: 14/12/2010, 10h53
  2. [AJAX] Affichage d'images style badoo
    Par SoGood dans le forum AJAX
    Réponses: 0
    Dernier message: 13/05/2009, 21h41
  3. BEAMER numérotation en style [plain]
    Par clement.rey dans le forum Beamer
    Réponses: 6
    Dernier message: 09/09/2008, 11h26
  4. Style de titre à numérotation décalée
    Par lguenhael dans le forum Word
    Réponses: 6
    Dernier message: 02/09/2008, 17h21

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