また、ツールチップを設定するコールバックと呼び出しを閉じるコールバックを常に呼び出すイテレータを使用して、リンク先リストを使用してツアーパートを作成することもできます。次に、必要なツールチップスクリプトを使用できます。ここで私は何を意味するかをお見せなければならないという概念の迅速な証拠です:
var toolTipList = {
tooltips: [],
currentTooltip: {},
addTooltip: function(tooltip){
var currentTail = this.tooltips.length > 0 ? this.tooltips[this.tooltips.length - 1] : {};
var newTail = {
tooltip: tooltip,
prev: currentTail
};
currentTail.next = newTail;
this.tooltips.push(newTail);
},
initialize: function(){
this.currentTooltip = this.tooltips[0];
this.currentTooltip.tooltip.callback();
},
next: function(){
if(this.currentTooltip.next){
this.currentTooltip.tooltip.close();
this.currentTooltip = this.currentTooltip.next;
this.currentTooltip.tooltip.callback();
}
}
};
for(var i = 0; i < 10; i++){
toolTipList.addTooltip({
callback: function(){
// called every time next is called
// open your tooltip here and
// attach the event that calls
// toolTipList.next when the next button is clicked
console.log('called');
},
close: function(){
// called when next is called again
// and this tooltip needs to be closed
console.log('close');
}
});
}
toolTipList.initialize();
setInterval(function(){toolTipList.next();}, 500);
JSFiddle link
私は最近で出版されたページ上の指導やWebアプリケーションのツアーについての短い[レビュー] [1]を書かれていますdailyjs.com。その中にこの機能を実装するためのいくつかのDIYソリューションがあります。 iridize.comで[サービスとしてのページ上のガイダンス] [2]をチェックしても大丈夫です。これをユーザーに提供するのが最善の方法だと思いますが、私はそれが最も簡単だろうと確信しています。 shame-less-yet-relevant-plug> [1]:http://dailyjs.com/2012/11/02/on-screen-guidance-intro [2]:https:// iridize.com –
odedbd