Changing info boxes?

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
Not quite sure how to word this, but here goes: I want to have twelve boxes with dates in for star signs, like 21-March to 20 April for Aries for instance in the first box and the dates for all the other star signs in the following eleven boxes; that's how it will look if you click a button for Aries... but I want the data (the dates) to shift across one, so 21-march to 20 April moves to the second box if you click Pisces....actually never mind that I've thought of a better way... I'd like to have twelve boxes that all display different info depending on the click of twelve different buttons, does that make any sense, can anyone help? :)
 

phlash

Fledgling Freddie
Joined
Dec 24, 2003
Messages
195
If you want to generate it from a script server-side, no problem, just use a loop counter, with an offset depending on the box clicked, and modulo the result to get the content index e.g. (in Java/JSP with no error handling :) ):

Code:
  int off = Integer.parseInt(request.getParameter("box"));
  for (int i=0; i<12; i++) {
    int idx = (i + off) % 12;
    // Get content: for example from an array indexed by idx
    out.println(content[idx]);
  }

Any good?
 

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
Oh God no, I'm really thick; that's not enough info.

I need it so if you click button 1 box 1 displays gif1 (for instance), box 2 displays gif2, box 3 displays gif 3, box 4 displays gif5 and so on up to box 12...

But if you click button two box 1 displays gif2 (instead of 1) box 2 displays gif3 and so on up to box 12 which displays gif 1

And so if you click button 3 it moves up again so box 1 displays gif3 and so on...


the gifs could be replaces by the dates, 21-march to 20 April , and such; or I could just make 12 gifs of the different dates to show up in the boxes which might be easier, I'm not sure? :)
 

phlash

Fledgling Freddie
Joined
Dec 24, 2003
Messages
195
That'll do :D It's basically the same thing in Javascript. You might want to move the actual horoscopes about as well as the dates though ;)
 

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
No no, the writing has to stay still; they're not horoscopes exactly. :)
 

Users who are viewing this thread

Top Bottom