automatically preload the activity feed when the scroll reaches the view more link

Started on the old forum in February 2015 · view the original in the archive · old links redirect here

3 replies · 166 views · started 11 years ago · 1 min read

2 participants
GumSlone Administrator Principal · 1,690 posts #1

open: /application/modules/Activity/views/scripts/_activityComments.tpl and add after:

<?php $this->headScript()
        ->appendFile($this->layout()->staticBaseUrl . 'application/modules/Activity/externals/scripts/core.js')
        ->appendFile($this->layout()->staticBaseUrl . 'externals/flowplayer/flashembed-1.0.1.pack.js') ?>

this code:

<script type = "text/javascript">
var check_load_more_gum_clicked = new Date().getTime();;
window.addEvent('domready', function() {
    window.addEvent('scroll', function() {
        var load_more_gum = (window.getScroll().y + window.getSize().y) > $('feed_viewmore_link').getPosition().y && $('feed_viewmore_link').offsetHeight > 1;
        var check_load_more_gum_now = new Date().getTime();
        if ((check_load_more_gum_now - check_load_more_gum_clicked) > 5000)
        {
            if (load_more_gum)
            {
                check_load_more_gum_clicked = new Date().getTime();
                document.getElementById("feed_viewmore_link").click();
            }
        }
    });
});
</script>

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

kevk3v Senior · 332 posts #2

Also try

$(window).scroll(function() {
if($(window).scrollTop() + $(window).height() == $(document).height()) {
$('#feed_viewmore_link, .conversation_showmore').click();    } }); 

Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com

kevk3v Senior · 332 posts #4

Oh I thought was for vbulletin lol... my bad, was on my phone

👍 1
Share

Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close