PDA

View Full Version : Pagination



viciosogb
11-02-2007, 06:11 PM
1) Script Title: Virtual Pagination script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/virtualpagination.htm

3) Describe problem:

Hi,

I have an HTML page, with an iframe in it. The iframe is supposed to change its source as user clicks on the pagination as follows:
previous 1񔘝񔿷 next

the source for the iframe should change accordingly from go_page1.htm to go_page2.htm to go_page3.htm, etc. to avoid the reloading of the whole HTML page.
the "Virtual Pagination script" do what Im searching but with DIVs, is possible to make the demo 3 works with my iframe?

Thanks for your help in advance

ddadmin
11-02-2007, 11:30 PM
If all you need is to display different pages within the same iframe when various links are clicked, you don't need a complex script for that. Just learn how to access an iframe and update its URL dynamically. For example:


<iframe id="test" src="about:blank" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="width:400px; height:300px;"></iframe>

<a href="javascript:gotopage('http://google.com')">Google</a> | <a href="javascript:gotopage('http://www.yahoo.com')">Yahoo</a>

<script type="text/javascript">

function gotopage(url){
document.getElementById("test").src=url
}
</script>

viciosogb
11-03-2007, 01:22 AM
thanks for answer, but how I can make work the "prev" and "next" buttons? and how to highlight the current page number opened in the iframe, for example:

at the begining is:

prev 1 2 3 4 next

and when user click on next:

prev 1 2 3 4 next

and so and so until reach 4. Also with the freedom for the user to click in any page number.

viciosogb
11-05-2007, 05:32 PM
No one has an idea plz :( , Im trying with arrays, but do this on every page with iframes I think is not correct, Im trying to do this with an external .js.

ddadmin
11-06-2007, 04:22 AM
It'll take some time before I can modify virtual pagination script to be IFRAME based, as it's more than just a few simple edits. In the meantime, have you looked at Ajax Tabs Content (http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/)? It supports an IFRAME mode (see 3rd demo) that should do most of what you need.

viciosogb
11-06-2007, 04:47 AM
Thanks so much for your help, the Ajax Tab Content works great.