Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Virtual Pagination script: jump to top next content

  1. #11
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I don't think so, though there's a small possibility that may also be a factor. What happened is that you did the opposite of what I suggested. Instead of putting:

    Code:
    <script src="https://croatia-luxury-villa.com/js/jquery.min.js"></script>
    before:

    Code:
        <script src="http://croatia-luxury-villa.com/js/virtualpaginate.js"></script>
    You put:

    Code:
        <script src="http://croatia-luxury-villa.com/js/virtualpaginate.js"></script>
    after the jQuery script. Unfortunately, virtualpaginate.js is needed before that. it's needed before:

    Code:
                                        <script type="text/javascript">
                                            var gallery=new virtualpaginate({
                                            piececlass: "virtualpage",
                                            piececontainer: 'div',
                                            pieces_per_page: 1,
    	                                    defaultpage: 0,
    	                                    wraparound: false,
    	                                    persist: true
                                            })
                                            gallery.buildpagination(["gallerypaginate", "gallerypaginate2"])
                                        </script>
    I suppose you could move that last part to the very end now. But I think it might work better if you just did it like I suggested in the first place.

    Yep, that's it. And once it's working, I think position() will work better than offset() - must have something to do with how the page is laid out. Not sure how cross device that will be (seems to be OK in limited emulation though).
    Last edited by jscheuer1; 09-25-2017 at 08:55 PM. Reason: add info
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  2. #12
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    I tried placing this in the footer:
    Code:
        <script src="https://croatia-luxury-villa.com/js/jquery.min.js"></script>
        <script src="http://croatia-luxury-villa.com/js/virtualpaginate.js"></script>
    
    <script type="text/javascript">
    (function(){
    	function loader(){
    		initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, 'savestate');
    	}
    	if (window.addEventListener)
    		window.addEventListener('load', loader, false);
    	else if (window.attachEvent)
    		window.attachEvent('onload', loader);
    })();
    </script>
    Doesn't work.
    And I also tried placing the follwing in the header:
    Code:
    <script src="https://croatia-luxury-villa.com/js/jquery.min.js"></script>
    and this in the footer:
    Code:
        <script src="http://croatia-luxury-villa.com/js/virtualpaginate.js"></script>
    
    <script type="text/javascript">
    (function(){
    	function loader(){
    		initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, 'savestate');
    	}
    	if (window.addEventListener)
    		window.addEventListener('load', loader, false);
    	else if (window.attachEvent)
    		window.attachEvent('onload', loader);
    })();
    </script>
    And also doesn't work.
    Quit confused now. And the chained menu is breaking my head ...

  3. #13
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I might not be the best person to explain this to you. I did get it working here using the console. I just moved:

    Code:
                                        <script type="text/javascript">
                                            var gallery=new virtualpaginate({
                                            piececlass: "virtualpage",
                                            piececontainer: 'div',
                                            pieces_per_page: 1,
    	                                    defaultpage: 0,
    	                                    wraparound: false,
    	                                    persist: true
                                            })
                                            gallery.buildpagination(["gallerypaginate", "gallerypaginate2"])
                                        </script>
    to the end and changed (in the virtualpaginate.js script):

    offset()

    to

    position()

    in that part we were already editing.

    But it seems whatever I say, you find a way to do something different. Partly my problem I'm sure. Sorry I wasn't able to help you more.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #14
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    Sorry, I copied wrong.
    So first I placed this all in the footer:
    Code:
    <script src="https://croatia-luxury-villa.com/js/jquery.min.js"></script>
        <script src="http://croatia-luxury-villa.com/js/virtualpaginate.js"></script>
    <script type="text/javascript">
    (function(){
    	function loader(){
    		initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, 'savestate');
    	}
    	if (window.addEventListener)
    		window.addEventListener('load', loader, false);
    	else if (window.attachEvent)
    		window.attachEvent('onload', loader);
    })();
    </script>
    But that didn't work.

    And then I separated them, placing this in the header:
    Code:
    <script src="https://croatia-luxury-villa.com/js/jquery.min.js"></script>
    and this in the footer:
    Code:
        <script src="http://croatia-luxury-villa.com/js/virtualpaginate.js"></script>
    
    <script type="text/javascript">
    (function(){
    	function loader(){
    		initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, 'savestate');
    	}
    	if (window.addEventListener)
    		window.addEventListener('load', loader, false);
    	else if (window.attachEvent)
    		window.attachEvent('onload', loader);
    })();
    </script>
    So I presume I placed the right code before the other code, as you explained.
    And I changed now offset into position.
    But it still doesn't work, so please advice.

  5. #15
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I never mentioned anything about the loader function. Where did that come from?

    Anyways, if you carefully go over all that I've already told you, everything you need is there. The only thing I haven't yet covered is how to have two or more "tops" if you need them. But for now we're just trying to get one top working with one pagination instance, and as I say, that's all there.

    The only other thing I can think of to do is to setup a demo for you. Assuming your page is still up and hasn't changed too much since I had it working in the console, when I have some time, I'll do that.

    Oh, and there's always the possibility that another participant in the forums will chime in. That's happened before. Sometimes that just confuses things further. But it has happened that another user understands what I'm saying and can explain it to the original person (you in this case).

    Still a good chance we will get this settled.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #16
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    OK, looks good, only problem I see now is that the:

    Code:
    <script src="http://croatia-luxury-villa.com/js/virtualpaginate.js"></script>
    is no longer on the page.

    Assuming things are as they were when I did this, here's a working demo:

    Edit: demo removed because problem solved and content likely proprietary
    Last edited by jscheuer1; 09-26-2017 at 09:08 PM. Reason: remove demo
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. The Following User Says Thank You to jscheuer1 For This Useful Post:

    chechu (09-26-2017)

  8. #17
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    Pff, I copied the wrong stuff again, must be the jetlag.
    Sorry, John, and thanks, indeed it all works well now. But the chained menu is still not working, and that I noticed whilst I was working on this pagination script with you.
    Any idea what could have happened there? Because it works when opening the link in a new tab, but then you'll see that the url of the page changes into this (ex.):
    Code:
    URL?firstlevel=&secondlevel=&thirdlevel=URL
    My aim is to have it opening in the same tab.
    Thanks.

  9. #18
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Glad that's working. And I answered your question about the chained menu in your thread that you started about that:

    http://www.dynamicdrive.com/forums/s...386#post322386
    Last edited by jscheuer1; 09-26-2017 at 02:30 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. The Following User Says Thank You to jscheuer1 For This Useful Post:

    chechu (09-26-2017)

  11. #19
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

  12. #20
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    Hey John,

    Still an issue, it seems. I added the code to another page, but instead of going back to #paginatetop, it goes back to the top of the page when clicking on the next content.
    See here: https://croatia-luxury-villa.com/test.php

    And what if I add another pagination to the same page? Then the #paginatetop cannot be used multiple times, it seems, because it is in the javascript.

    Also, is it possible to add a feature so that the scrolling to the top of the content goes with a smooth transition?

    Thanks!

Similar Threads

  1. Virtual Pagination script v2.0
    By chas in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 06-01-2009, 02:23 AM
  2. Help with Merging Virtual Pagination & Scrollable Content Scripts
    By mmalik in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 01-02-2009, 06:08 PM
  3. Virtual Pagination within Tabbed Content
    By touchnova in forum Dynamic Drive scripts help
    Replies: 11
    Last Post: 09-13-2008, 03:31 PM
  4. Virtual pagination and run active content
    By orion3000 in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 01-15-2008, 04:52 AM
  5. Altering a content loop script for Virtual Pagination
    By JBottero in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 06-03-2007, 07:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •