1
私はインタラクティブを作成していますが、divには3つの色があります。ユーザーが色をクリックすると、ユーザーが選択した色として画像が次のセクションに読み込まれます。私は異なる色のジャケットの3つのPNGのを作成したと私は彼らが選択するオプションに応じてジャケットの色を読み込む方法を知る必要があります。'onclickイベント'に基づいてイメージを読み込む方法
<div id="page-colour">
<h1>About your jacket.</h1>
<h2>Select your leather jacket colour.</h2>
<div class="col-md-offset-3 col-md-2">
<div class="black-button colourButton">
<p>Black</p>
</div>
</div>
<div class="col-md-2">
<div class="brown-button colourButton">
<p>Brown</p>
</div>
</div>
<div class="col-md-2">
<div class="white-button colourButton">
<p>White</p>
</div>
</div>
</div>
<div id="page-build">
<div class="theJacket col-xs-3 col-md-9">
<img class="" src="img/black-jacket.png" class="img-responsive" alt="Black Leather Jacket" width="600" height="750"/>
</div>
</div>
は、これは私が次のページをロードされている方法です。
$(document).ready(function(){
$('.intro-button').click(function(){
transition("#page-jacket","fade");
});
function transition(toPage, type){
var toPage = $(toPage),
fromPage = $("#pages .current"); // store the page that is currently showing
toPage
.addClass("current " + type + " in")
.one("msAnimationEnd animationend oAnimationEnd", function(){ // listens for when the animation has finished
fromPage.removeClass("current " + type + " out");
toPage.removeClass(type + " in");
});
fromPage.addClass(type + " out ");
}
、ありがとう! 次のページにロードする方法が分かりますか?その代わりに、色のリストの下のロードが、私が使用してページをロードした後:。 \t $(「colourButton」)をクリックします(関数(){ \t \t移行( 『#ページ・ビルド』、 "フェード"); \t}); – adammhiggins
それを無視して、作品!助けを感謝します – adammhiggins
ニース、私は助けることがうれしいです。 – jao