Visualizzazione dei risultati da 1 a 6 su 6

Hybrid View

  1. #1
    Utente di HTML.it L'avatar di echoweb
    Registrato dal
    Sep 2008
    Messaggi
    419
    ciao,

    prova cosi...

    codice:
    <script>
    
    
    $(document).ready(function(){  
      $('.boxTeam').width('200px');
      $('.boxTeam').height('150px');
      $('.boxInfo').width('0px');
      $('.boxLogo').width('100%');
      $('.boxCategory').width('0px');
      $('.boxData').width('0px');
      
      
      $(".boxTeam").each(function () {
        work(this.id);
      });
    
    
      function work(_id)
      {
            var _id = '#' + _id;
            
            $(_id ).css("cursor","pointer").click(function() {
    
    
                $(_id).animate({
                        width: "100%",
                        height: "auto",
                        minHeight:"150px"
                  });
    
    
                 $(_id + '>.boxInfo').animate({
                        width: "70%",
                        height: "auto",
                        minHeight:"150px"
                  });
    
    
                 $(_id + '>.boxLogo').animate({
                        width: "30%"
                  });
    
    
                  $(_id + '>.boxCategory').animate({
                        width: "100%",
                        height: "50px"
                  });
    
    
                  $(_id + '>.boxData').animate({
                        width: "100%",
                        height: "50px"
                  });
    
    
            });
    
    
            $(_id).mouseout(function() {
                $(_id).animate({
                        width: "200px",
                        height: "150px"
                  });
                $(_id + '>.boxInfo').animate({
                        width: "0%",
                        height: "auto",
                        minHeight:"150px"
                  });
    
    
                 $(_id + '>.boxLogo').animate({
                        width: "100%"
                  });
            });
      
      
      } 
      
        
      
    });
    </script>


    "Non soffocare la tua ispirazione e la tua immaginazione,
    non diventare lo schiavo del tuo modello"

    Vincent van Gogh

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2013
    Messaggi
    61
    Quote Originariamente inviata da echoweb Visualizza il messaggio
    ciao,

    prova cosi...

    codice:
    <script>
    
    
    $(document).ready(function(){  
      $('.boxTeam').width('200px');
      $('.boxTeam').height('150px');
      $('.boxInfo').width('0px');
      $('.boxLogo').width('100%');
      $('.boxCategory').width('0px');
      $('.boxData').width('0px');
      
      
      $(".boxTeam").each(function () {
        work(this.id);
      });
    
    
      function work(_id)
      {
            var _id = '#' + _id;
            
            $(_id ).css("cursor","pointer").click(function() {
    
    
                $(_id).animate({
                        width: "100%",
                        height: "auto",
                        minHeight:"150px"
                  });
    
    
                 $(_id + '>.boxInfo').animate({
                        width: "70%",
                        height: "auto",
                        minHeight:"150px"
                  });
    
    
                 $(_id + '>.boxLogo').animate({
                        width: "30%"
                  });
    
    
                  $(_id + '>.boxCategory').animate({
                        width: "100%",
                        height: "50px"
                  });
    
    
                  $(_id + '>.boxData').animate({
                        width: "100%",
                        height: "50px"
                  });
    
    
            });
    
    
            $(_id).mouseout(function() {
                $(_id).animate({
                        width: "200px",
                        height: "150px"
                  });
                $(_id + '>.boxInfo').animate({
                        width: "0%",
                        height: "auto",
                        minHeight:"150px"
                  });
    
    
                 $(_id + '>.boxLogo').animate({
                        width: "100%"
                  });
            });
      
      
      } 
      
        
      
    });
    </script>
    Non fa nulla , non parte neanche l'animazione , devo inserire altro da qualche altra parte?

  3. #3
    Utente di HTML.it L'avatar di echoweb
    Registrato dal
    Sep 2008
    Messaggi
    419
    aggiungi l'id ai box:
    codice:
    ...
    <div class ="boxTeam" id="boxTeam1">
    ...
    <div class ="boxTeam" id="boxTeam2">
    ...


    "Non soffocare la tua ispirazione e la tua immaginazione,
    non diventare lo schiavo del tuo modello"

    Vincent van Gogh

  4. #4
    Utente di HTML.it
    Registrato dal
    Sep 2013
    Messaggi
    61
    Schermata 2014-08-07 alle 10.14.47.jpg

    Questo dovrebbe essere il risultato finale quando si clicca su uno dei due div ma gli elementi interni si scompongono cosi :

    Schermata 2014-08-07 alle 10.17.39.jpg

    come posso risolvere?

    EDIT:

    Risolto gestendo la successione delle classi con il maggiore [>]

    GRAZIE!!!
    Immagini allegate Immagini allegate
    Ultima modifica di netkingZ; 07-08-2014 a 10:57

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.