<ul>
<li>
<div class="p1 pe" data-block="pt1"></div>
<div class="p2 pe" data-block="pt2"></div>
</li>
<li>
<div class="pt pt1"></div>
<div class="pt pt2"></div>
</li>
</ul>
$(function(){
$('.pe').on('mouseenter', function(){
var block = $(this).data('block');
$('.'+block).fadeTo(200,1);
});
$('.pe').on('mouseleave', function(){
$('.pt').fadeTo(200,0);
});
});
document.getElementsByClassName('p1')[0].onmouseover = function() {
document.getElementsByClassName('pt1')[0].style.opacity = 1;
}
document.getElementsByClassName('p1')[0].onmouseout = function() {
document.getElementsByClassName('pt1')[0].style.opacity = 0;
}