Tuesday, December 21, 2010

Coding possibility

Below is a rough outline of how jQuery will be used to handle the image switching, where variable i is set depending on which button is clicked.

Note: This doesn't detail on how buttons will be handled, i.e. displayed and subsequently hidden.
This is just for image loading.

1st Choice
Button 1 - i = 2
Button 2 - i = 3

2nd Choices
Button 3 - i = 4
Button 4 - i = 5

Button 5 - i = 6
Button 6 - i = 7



Each button will have the same class of "button" so as to call the same click method.

$("button").click(function (i) { //where i is received from the method responsible for setting var i.
    
    switch (i){
        case 2:
             $("#choice1").load(/images/02.jpg); //#choice1 is an empty div where images will be placed
   
        case 3:
         .....
//so on and so forth for each possibility of i (2 - 7)

   }
)};


- T.J.