Team:UCLA/anuved verma ucla2014 workspace/Javascript

From 2014.igem.org

(Difference between revisions)
Line 43: Line 43:
<!--MAIN PAGE BOXES-->
<!--MAIN PAGE BOXES-->
<script type="text/javascript">
<script type="text/javascript">
-
$(document).ready(function(){
+
    $(document).ready(function() {
-
$(".content_div_container").mouseover(function() {
+
        $('#box5').hover(function(){
-
$(this).find(".content_div_text").stop().animate({
+
            var smallTop = $('#box5').height() - $(".cover", this).height() -10 +"px";
-
"top": "100px"
+
    $(".cover", this).stop().animate({top:smallTop},{queue:false,duration:160});
-
}, 250);
+
}, function() {
 +
    $(".cover", this).stop().animate({top:'340px'},{queue:false,duration:160});
});
});
-
$(".content_div_container").mouseout(function() {
+
        $('#box6').hover(function(){
-
$(this).find(".content_div_text").stop().animate({
+
            var smallTop = $('#box6').height() - $(".cover", this).height() -10 +"px";
-
"top": "300px"
+
    $(".cover", this).stop().animate({top:smallTop},{queue:false,duration:160});
-
}, 250);
+
}, function() {
 +
    $(".cover", this).stop().animate({top:'340px'},{queue:false,duration:160});
});
});
-
});
+
                $('#box7').hover(function(){
 +
            var smallTop = $('#box7').height() - $(".cover", this).height() -10 +"px";
 +
    $(".cover", this).stop().animate({top:smallTop},{queue:false,duration:160});
 +
}, function() {
 +
    $(".cover", this).stop().animate({top:'340px'},{queue:false,duration:160});
 +
});
 +
    });
</script>
</script>

Revision as of 23:58, 18 September 2014