ElementAffect [required]

Pass in the class of the elements that will be modified when the event is triggered.

ElementAffect : ".hiddenElement"

ElementsToShow

This parameter is used to determine how many elements to show (ElementAffect) when the plugin determines that itemone is in the viewport. This parameter only accepts a number.

ElementsToShow : 5

GatherAfterTrigger

Boolean value. Set to false by default so as to not update the DOM after each time ScrollAppear is triggered, this will make the plugin faster. Note, ScrollAppear automatically monitors the DOM for changes and gathers all eligible elements after each change. GatherAfterTrigger has a primary impact on the Callback state.numberOfElements property.

GatherAfterTrigger: true

NumberOfScrolls

This is used to constrain how many times the plugin will successfully execute. Default is set to 100. Only accepts a number value.

NumberOfScrolls: 20

PixelOffset

This can be used to refine when the trigger point for itemone by setting an offset. By setting a negative value the element will need to be visible plus the offset before the event will trigger. By setting a positive offset, the event will trigger before the element is visible plus the offset. Only accepts a number value, no “px” required.

Default value is set to 0.

PixelOffset : 200

Timeout

Used to set how long between monitoring the trigger event. A higher number is generally preferred to prevent mass triggering of the event which can cause undesirable strain on the browser if you have a significant number of hidden elements.

Accepts a number, default is 1000.

Timeout : 2000

TriggerIntent

Set to true by default. This value is used to determine if the plugin should check to see if itemone is in the viewport again after being triggered.

TriggerIntent : false

TriggerType

Accepts a string, default is "scroll". Refer to the following pages in the jQuery API for complete set of options:

Marcel

August 14, 2014 at 10:27 am

Nevermind I figued it out. The scroll never fired because the body was not tall enough to actually scroll. I made the first 3 rows load automatically. I would have replied sooner but earlier, I could not see my comment.

Dom, this is a cool plugin, but I have an issue in the code. I see in the js file the .each section with the list of actions that if found in the page interferes with the plugin operation (passing DomUpdate as the object instead of the ScrollAppear settings). I comment that section out and everything works. Where I am trying to use it I have other page elements being modified with .append or .each and the presence of those methods causes your plugin to not operate. Mainly I’m wondering what that section is meant for?

Thanks Michael. The section you’ve mentioned (Line 244 onwards) is there to basically monitor the DOM for any elements that might be added after the plugin has been initialised without having to call jQuery(".myclass").ScrollAppear("DomUpdate");. The demo page demonstrates (the Add Elements button) adding manually created elements on click (after the plugin has been initialised) using the insertBefore jQuery function, which are then picked up by the plugin. I also ran a quick test using .append() and it worked fine. Where have you placed your code in relation to invocation of jQuery ScrollAppear? What version of jQuery are you using? Do you have a link to a page where I can view this issue?

It sure would be. I have tried to steer clear of implementing that type of functionality in the plugin as I felt that this would be best left to the user to implement based on their requirements. If you have a working example, I’d be happy to give some pointers.

Would the addition of having the ability to call a function each time a scollappear event is fired be helpful?

Hello
I was wondering whether you had a quick example how to use this jquery plugin pulling in wordpress posts – what I’m actually trying to do is to pull in some wordpress galleries – since WP gallery doesn’t support pagination I try to use the offset parameter. hope you got some code to get me going.

Unfortunately I don’t have any code for pulling in paginated WordPress galleries, that’s not really within the scope of jQuery ScrollAppear.

I am looking to push an update to the plugin within the next month to support a callback function as outlined in my previous comment. You could potentially hook an ajax call inside that function, but I don’t have any code examples for this as I don’t use WordPress galleries.

If you work out how to pull in more galleries into the page and they have the same classes as you’ve used in the initialisation of jQuery ScrollAppear, the plugin will automatically bind to these new elements created (assuming you’ve added them with jQuery) and show them on scroll. The jQuery ScrollAppear demo page has an example of this when you click the “AddElements” button.

If you have any more questions just let me know or if you’d like link me to some of your work in progress I can provide some pointers.

Following up from my previous comment, I’ve added a new parameter to the plugin that allows you to pass a callback function each time more elements are displayed. Hopefully this might give you a little help :)