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;
}
Javascriptを:
$('.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