Flexslider は、最初に表示するスライドを表すインデックスを受け入れる「startAt」というプロパティを提供します。また、'slideshow' パラメータを false に設定して、スライドショーの自動再生を無効にすることもできます。スライドショーを作成する前に開始したいスライド参照を取得する場合は、これらのパラメーターを使用できます。
// create a variable to store the slide index to start at.
startAtSlideIndex = 0;
// see if a tab anchor has been included in the url
if (window.location.hash != '') {
// Set the startAtSlideIndex variable to one less than the ordinal passed
// note: if you have more than 9 slides, this will fall down and you'll
// have to do some more complex string manipulation.
// A querystring variable might be easier, especially if you use
// someone else's url parser ;)
// Important: assumes the format of the hash is '#tabN' where N is the digit we want.
startAtSlideIndex = window.location.hash.substr(4,1)-1;
}
$("#flexslider-container").flexslider({
// other flexslider params
// set the flexslider startAt param to the value of the startAtSlideIndex variable
startAt: startAtSlideIndex
});
編集:元の回答で、場所オブジェクトに「ハッシュ」プロパティがあることを忘れていました。