user701510
user701510

Reputation: 5763

making my own jquery pagination

I've made my own jquery pagination where when you press the page button, the current page disappears and then the page , which corresponds to the button number, fades in. The problem is that page 2 appears but a little lower than where page 1 appears and page 3 is even lower than where page 1 was. Every page that appears is supposed to be at the same position where page 1 starts out at.

jsfiddle

Upvotes: 0

Views: 254

Answers (4)

Higgsy
Higgsy

Reputation: 324

The guys above are right but, when I do mine, I just position with css. To me, this is a stylesheet problem. Lose the breaks.

Upvotes: 0

MK_Dev
MK_Dev

Reputation: 3333

Remove BRs between "page" elements as well as the ones that are inside the page elements.

Upvotes: 0

Nanne
Nanne

Reputation: 64409

You simply have too many breaks.

compare the beginning of page 1

    <div id="page1" class="page">
           <li id="panel">

with that of page 2

       </li></div><br><div id="page2" class="page"><br/>

Upvotes: 1

jeffreydev
jeffreydev

Reputation: 1722

It's because you have a <br> between the page elements.

This break tag adds extra space above your pages.

Between page 1 and 2 there is one <br>, So page 2 has 1 empty line above it. Between page 1 and 3 there are two <br>'s and so there are 2 empty lines above page 3.

Upvotes: 2

Related Questions