Notebook
Siamo lieti di annunciare che il forum è stato ottimizzato per la navigazione da cellulari. Ma è ancora in versione Beta di questa funzionalità pertanto t'invitano a provare sul tuo cellulare. Clicca qui per maggiori informazioni
Switch
Switch Accounts


Cerca
 
 

Risultati per:
 


Rechercher Ricerca avanzata

Parole chiave

Ultimi argomenti attivi
» fsdfwsdfcsdcds<xcvSDFCSDACSDCSDA
Popout Details on Hover w/ CSS EmptyDom Mar 17, 2013 5:08 pm Da Niko

» Come presentarsi
Popout Details on Hover w/ CSS EmptyGio Dic 27, 2012 1:11 pm Da Niko

» Suono nella chat
Popout Details on Hover w/ CSS EmptyGio Gen 26, 2012 5:47 pm Da Niko

» Creare un pannello utente
Popout Details on Hover w/ CSS EmptyDom Gen 22, 2012 5:25 pm Da Niko

» Avere una barra sotto al forum
Popout Details on Hover w/ CSS EmptyDom Gen 22, 2012 5:13 pm Da Niko

» Verificare la disponibilità dei nomi utente
Popout Details on Hover w/ CSS EmptyVen Gen 20, 2012 10:28 am Da Niko

» Modificare le immagini per le password
Popout Details on Hover w/ CSS EmptyVen Gen 20, 2012 10:26 am Da Niko

» Modificare la lingua del forum per ogni utente
Popout Details on Hover w/ CSS EmptyVen Gen 20, 2012 10:25 am Da Niko

» Modificare il testo di valutazione per le password
Popout Details on Hover w/ CSS EmptyVen Gen 20, 2012 10:24 am Da Niko

Ottobre 2024
LunMarMerGioVenSabDom
 123456
78910111213
14151617181920
21222324252627
28293031   

Calendario Calendario

Partner
creare un forum


Non sei connesso Connettiti o registrati

Visualizza l'argomento precedente Visualizza l'argomento successivo Andare in basso  Messaggio [Pagina 1 di 1]

<

Popout Details on Hover w/ CSS

Posted by Bénévoles on Ven Dic 23, 2011 12:37 pm


Hi pure-members!
here you are the tutorial...



Popout Details on Hover w/ CSS


Tags:




I recently saw a hover over trick that caught my eye and I thought it was a pretty clever way of showing more details on an element. I decided to give it a try and the solution was quite simple.

Popout Details on Hover w/ CSS



HTML


The columns are made up of unordered list items, within each list item is the thumbnail image and the details of the item wrapped in a class of "info".


Codice:
<pre><ul class="columns">
    <li>
       <a href="#"><img src="thumbnail.jpg" alt="" /></a>
        <div class="info">
            <h2>Title</h2>
            <p>Short Description</p>
        </div>
    </li>
</ul></pre>

Popout Details on Hover w/ CSS


CSS


Start by styling the list items. Notice we add position: relative; to the list item, and on hover we raise the z-index to 99 so it lifts over the other elements.


Codice:
<pre><span style="color: #777;">/*--Column Styles--*/</span>
ul.columns {
   width: 960px;
   list-style: none;
   margin: 0 auto; padding: 0;
}
ul.columns li {
   width: 220px;
   float: left; display: inline;
   margin: 10px; padding: 0;
   position: relative;
}
ul.columns li:hover {z-index: 99;}</pre>

We add a position: relative; to the image as well, so we can control the z-index value on hover. What we want to do here is to lower the opacity of the image by default to 30% then on hover, turn up the opacity to 100% and lift the image by increasing the z-index value to 999. This will allow the thumbnail to sit on top of the .info elements.


Codice:
<pre><span style="color: #777;">/*--Thumbnail Styles--*/</span>
ul.columns li img {
   position: relative;
   filter: alpha(opacity=30);
   opacity: 0.3;
   -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; <span style="color: #777;">/*--IE8 Specific--*/</span>
}
ul.columns li:hover img{
   z-index: 999;
   filter: alpha(opacity=100);
   opacity: 1;
   -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
}</pre>

Use absolute positioning to shift the .info class -10px to the left and -10px to the top. Since .info is using an absolute positioning, we must have enough top padding so the content within does not overlap the thumbnail. To do this, the top padding is measured by adding 10px to the height of the thumbnail (200px in my demo). Some CSS3 was added for the rounded corners. We will hide .info by default, and show it on hover.


Popout Details on Hover w/ CSS


Codice:
<pre><span style="color: #777;">/*--Details Style--*/</span>
ul.columns li .info {
   position: absolute;
   left: -10px; top: -10px;
   padding: 210px 10px 20px;
   width: 220px;
   display: none;
   background: #fff;
   font-size: 1.2em;
   -webkit-border-radius: 3px;
   -moz-border-radius: 3px;
   border-radius: 3px;
}
ul.columns li:hover .info {display: block;}

ul.columns li h2 {
   font-size: 1.2em;
   font-weight: normal;
   text-transform: uppercase;
   margin: 0; padding: 10px 0;
}
ul.columns li p {padding: 0; margin: 0; font-size: 0.9em;}</pre>

Final Thoughts


Go ahead and experiment with this technique! If you have any questions or concerns please don’t hesitate to let me know. For those concerned with this technique working on IE6, you can use some jQuery tricks to get around the hover issue.


Popout Details on Hover w/ CSS




bye, irian

https://mods.forumattivo.com

Visualizza l'argomento precedente Visualizza l'argomento successivo Torna in alto  Messaggio [Pagina 1 di 1]

Permessi in questa sezione del forum:
Non puoi rispondere agli argomenti in questo forum.

Forum gratuito | ©phpBB | Forum gratis di aiuto | Segnala un abuso | Ultime discussioni