Using the wordpress loop and jquery, I'm trying to show/hide the content of the posts displayed. Example: user hovers title and tags then clicks and the content expands.
After some searches I've come to this result.
It almost works. The first post works fine, but the second posts expands the content of the first and second post. And it doesn't stop from showing/hiding. Content seems to be jumping!.. weird stuff.. Oh! Just noticed that these "jumps" are incremental, starts with 1, then 2, then 3, ...
Thanks in advance! (And sorry for any mistake in my english.)
Dani
Edit:
Here's the HTML
And the CSS:
After some searches I've come to this result.
Code:
$f(function(){
$f(".portfolio-destaques").hover(function(){
$f( ".change" ).toggle(
function() {
$f('.highlight').slideUp('fast');
},
function() {
$f('.highlight').slideDown('fast');
});
});
});
It almost works. The first post works fine, but the second posts expands the content of the first and second post. And it doesn't stop from showing/hiding. Content seems to be jumping!.. weird stuff.. Oh! Just noticed that these "jumps" are incremental, starts with 1, then 2, then 3, ...
Thanks in advance! (And sorry for any mistake in my english.)
Dani
Edit:
Here's the HTML
Code:
<div id="portfolioContent">
<div class="portfolio-destaques">
<p class="destaques-data">2010-03-10</p>
<h3><a href="#" class="change">Mauris aliquet mattis metus</a></h3>
<p>Requerente: <a href="http://localhost:8888/aspp/requerente/ornare/" rel="tag">Ornare</a> <a href="http://localhost:8888/aspp/requerente/pede/" rel="tag">Pede</a> Localização: <a href="http://localhost:8888/aspp/localizacao/matosinhos/" rel="tag">Matosinhos</a> Tipologia: <a href="http://localhost:8888/aspp/tipologia/amet/" rel="tag">Amet</a> <a href="http://localhost:8888/aspp/tipologia/elit/" rel="tag">Elit</a></p>
<div class="highlight">
<p>Aliquam aliquet, est a ullamcorper condimentum, tellus nulla fringilla elit, a iaculis nulla turpis sed wisi. Fusce volutpat. Etiam sodales ante id nunc. Proin ornare dignissim lacus. Nunc porttitor nunc a sem. Sed sollicitudin velit eu magna. Aliquam erat volutpat. Vivamus ornare est non wisi. Proin vel quam. Vivamus egestas. Nunc tempor diam vehicula mauris. Nullam sapien eros, facilisis vel, eleifend non, auctor dapibus, pede.</p>
</div>
</div>
<div class="portfolio-destaques">
<p class="destaques-data">2006-11-08</p>
<h3><a href="#" class="change">Cras aliquam massa ullamcorper sapien</a></h3>
<p>Requerente: <a href="http://localhost:8888/aspp/requerente/enim/" rel="tag">Enim</a> Localização: <a href="http://localhost:8888/aspp/localizacao/matosinhos/" rel="tag">Matosinhos</a> Tipologia: <a href="http://localhost:8888/aspp/tipologia/ipsum/" rel="tag">Ipsum</a></p>
<div class="highlight">
<p>Pellentesque vel dui sed orci faucibus iaculis. Suspendisse dictum magna id purus tincidunt rutrum. Nulla congue. Vivamus sit amet lorem posuere dui vulputate ornare. Phasellus mattis sollicitudin ligula. Duis dignissim felis et urna. Integer adipiscing congue metus. Nam pede. Etiam non wisi. Sed accumsan dolor ac augue. Pellentesque eget lectus. Aliquam nec dolor nec tellus ornare venenatis. Nullam blandit placerat sem. Curabitur quis ipsum. Mauris nisl tellus, aliquet eu, suscipit eu, ullamcorper quis, magna. Mauris elementum, pede at sodales vestibulum, nulla tortor congue massa, quis pellentesque odio dui id est. Cras faucibus augue.</p>
</div>
</div>
And the CSS:
Code:
#portfolioContent {
position: absolute;
top: 20px;
right: 60px;
width: 670px;
}
.portfolio-destaques {
position: relative;
background: transparent url('images/menu_bg_dark.png');
}
.portfolio-destaques:hover {
background: transparent url('images/menu_bg.png');
}