2
이미지 위에 마우스를 올리면 다른 이미지로 바뀌고 타임 라인을 클릭하면 다른 이미지로 바뀝니다. 타임 라인의 다른 부분을 클릭하면 방금 클릭 한 부분이 꺼집니다. 아무도 이것으로 나를 도울 수 있습니까?뭔가 다른 것을 클릭하면 정적, 마우스 오버, 클릭, 마우 스로우
내가 지금까지 가지고있는 것입니다.
HTML :
<div class="all-bullets">
<div class="bulletPlayer">
<a class="bulletOne"></a><br />
</div>
<div class="bulletPlayer">
<a class="bulletTwo"></a><br />
</div>
<div class="bulletPlayer">
<a class="bulletThree"></a><br />
</div>
<div class="bulletPlayer">
<a class="bulletFour"></a><br />
</div>
</div>
CSS :
.all-bullets {
display: inline-block;
vertical-align: top;
width: 492px;
margin-left: -41px;
margin-top: 140px;
}
.bulletPlayer {
position: relative;
z-index: 9999;
}
/* BULLET ONE*/
.bulletOne {
display: inline-block;
width: 500px;
height: 126px;
background: url(images/dotOneUpState.png) no-repeat left top;
}
.bulletOne:hover
{
background: url(images/dotOneHoverState.png) no-repeat left top;
margin-left: -5px;
margin-top: -3px;
margin-bottom: 3px;
}
.bulletOne.active
{
background: url(images/dotOneDownState.png) no-repeat left top;
margin-left: -5px;
margin-top: -3px;
margin-bottom: 3px;
}
/* BULLET TWO*/
.bulletTwo {
display: inline-block;
width: 500px;
height: 126px;
background: url(images/dotTwoUpState.png) no-repeat left top;
}
.bulletTwo:hover
{
background: url(images/dotTwoHoverState.png) no-repeat left top;
margin-left: -3px;
margin-top: -3px;
margin-bottom: 3px;
}
.bulletTwo.active
{
background: url(images/dotTwoDownState.png) no-repeat left top;
margin-left: -3px;
margin-top: -3px;
margin-bottom: 3px;
}
/* BULLET THREE*/
.bulletThree {
display: inline-block;
width: 500px;
height: 126px;
background: url(images/dotThreeUpState.png) no-repeat left top;
}
.bulletThree:hover
{
background: url(images/dotThreeHoverState.png) no-repeat left top;
margin-left: -4px;
margin-top: -3px;
margin-bottom: 3px;
}
.bulletThree.active
{
background: url(images/dotThreeDownState.png) no-repeat left top;
margin-left: -4px;
margin-top: -3px;
margin-bottom: 3px;
}
/* BULLET FOUR*/
.bulletFour {
display: inline-block;
width: 500px;
height: 123px;
background: url(images/dotFourUpState.png) no-repeat left top;
cursor: pointer;
}
.bulletFour:hover
{
background: url(images/dotFourHoverState.png) no-repeat left top;
margin-left: -3px;
margin-top: -3px;
margin-bottom: 3px;
}
.bulletFour.active
{
background: url(images/dotFourDownState.png) no-repeat left top;
margin-left: -3px;
margin-top: -3px;
margin-bottom: 3px;
}
자바 스크립트 :
$('.bulletOne').click(function(){
if($(this).hasClass('active')){
$(this).removeClass('active')
} else {
$(this).addClass('active')
}
});
$('.bulletTwo').click(function(){
if($(this).hasClass('active')){
$(this).removeClass('active')
} else {
$(this).addClass('active')
}
});
$('.bulletThree').click(function(){
if($(this).hasClass('active')){
$(this).removeClass('active')
} else {
$(this).addClass('active')
}
});
$('.bulletFour').click(function(){
if($(this).hasClass('active')){
$(this).removeClass('active')
} else {
$(this).addClass('active')
}
});
당신이 * * 아무것도를 시도하거나 우리가 당신을 spoonfeed 하시겠습니까 : 여기 조각은 무엇입니까? – Li357
실례 합니다만 여기 지식이없는 사람들로부터 피드백을 얻기 위해 왔으며 무례한 답변이 아닙니다. 나는 아직도 배우고 있으며 나는 이것에 대해 매우 새롭고 하루 종일 JS 피들을 연구하고 시도하고있다. 나는 당신이 지금까지 무엇을 가지고 있는지 보여주고 기꺼이 도와 주겠다. 수동적이지는 않다. –
노력을 보여주고 능동적으로 답을 얻는 사람들에게 기꺼이 도와 주겠다. 당신이 무언가를 시도했다면, 우리를 보여줄 수 있도록 우리를 보여주십시오. 아무런 노력을하지 않을 때 우리는 당신이 아무 것도하지 않았다는 느낌을 주며, 아무런 노력없이 답을 얻고 싶습니다. 아무도 여기있는 사람을 도울 의무가 없습니다. 그리고 모든 사람들은 자기 비용으로 여기에 있습니다. – Li357