I am building a thumbnail of brands that have icon view and edit each other.. I want to hover all icon when one of them hovered.
Here the structure that I have ..
<div id="brands-wrapper">
<img class="brands" src="http://localhost/infodiskon/images/'.$data->image_brand.'">
<div id="icon-wrapper">
<a href="#" id="view">
<img src="http://localhost/infodiskon/assets/images/view_icon.png">
</a>
<a href="#" id="edit">
<img src="http://localhost/infodiskon/assets/images/edit_icon.png">
</a>
</div>
<h3>'.$data->brand_name.'</h3>
<h4>'.$data->location.'</h4>
</div>
I have used a version 2.1.3 of jquery with google CDN.
And also I just trying to alert when icon view hovered . a script :
$(document).ready(function() {
$("#view").hover(
function() {
alert("Yo");
}
);
});
alert just showed up when the first item only hovered not with the other one..
What I want is to show all icon when one of them hovered??? I just want to change the opacity to 1. I can use :hover in css but it just working with only tag of it.
css
#icon-wrapper{
position: absolute;
top: 0;left: 0;
}
#icon-wrapper .view, #icon-wrapper .edit{
display: block;
width: 194px;
height: 94px;
line-height: 94px;
text-align: center;
background-color: #363636;
opacity: 0;
color: white;
text-decoration: none;
}
.view>img{margin-bottom: -16px;}
.edit>img{margin-bottom: -10px;}
#icon-wrapper .view{margin-bottom: 6px;}
#icon-wrapper .view:hover, #icon-wrapper .edit:hover{
opacity: .8;
}
.hoverto a class which all elements share. At the moment, youre just binding it to one id called#view