Smoetimes i hate CSS and more importanly javascript (in this case, jQuery). I've got the following:
#project {
opacity: 0.2;
float: left;
margin: 10px;
}
And in my HTML i've got:
<script type="text/javascript">
$('#project img').hover(function() {
$(this).fadeTo("slow", 1);
});
</script>
<div id="project">
<div id="img"><img src="..."></div>
<p>Title:</p> ...
</div>
But for some reason, i can't fade to 1.0
because 1.0
being the maximum value of the opacity which is set to 0.2
in my CSS file.
If i do fadeTo("slow", 0.5);
concequently it will fade to 0.1
.
How can i, in a simple way animate a "fade in" from a predefined 0.2
opacity to full opacity?
Edit: The CSS part is loaded on the first page load, the HTML part is loaded via AJAX ($("#content").load($(this).text() + ".html");
) later on.