私がここでやろうとしているのは、次のフィールドセットのIDで次のフィールドセットをロードするように、現在の表示フィールドの次のフィールドセットのIDを取得することです。次の可視オブジェクトのIDをリンクに追加する
最高の成果は次のIDの1つを得ることですが、停止します。
$(".next").on("click", function() {
$('this').attr("href", function() {
return "#" + $('fieldset:visible"').next("fieldset").attr("id");
});
});
a{position:fixed;left:0;bottom:0;z-index:999;background:black;color:#fff;padding:50px;}
html,body,fieldset{width:100%;height:100%;}
fieldset{position:relative;}
#one{background-color:red}
#two{background-color:green}
#three{background-color:blue}
#four{background-color:red}
#five{background-color:green}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<a class="next" href="#two">NEXT</a>
<fieldset id="one"></fieldset>
<fieldset id="two"></fieldset>
<fieldset id="three"></fieldset>
<fieldset id="four"></fieldset>
<fieldset id="five"></fieldset>
と前方に得ることができます。 –
あなたは1つを隠す必要があります。 – Hemal
クリックするたびに、常に最初のものから始まります。 – Hemal