Archive for the ‘Tools’ Category

jQuery onScrollBeyond and scrollExtend plugins – infinite scroll with ajax

Thursday, June 17th, 2010

The scrollExtend plugin is designed to automatically load new content at the bottom of the screen (by appending to a DOM element) when the user scrolls beyond the element, much like Facebook does with their status updates. The existing infinite scroll plugin was primarily designed to integrate with Wordpress, which didn’t really suit my purposes.

There are two plugins encapsulated here – onScrollBeyond, which allows the developer to specify a callback to be run when an element is scrolled beyond (or the end of the document is reached), and scrollExtend, which is simply an implementation of onScrollBeyond that automatically loads new content via ajax when a user scrolls past an element.

Works with jQuery 1.3.2 and jQuery 1.4.2

Tested in IE6, IE7, Firefox, Chrome, Safari

Originally created for the Junebug dating site

 

Update v1.0.1 – fixed scrollExtend would get stuck in a disabled state if beforeStart returned false, even if it returned true on subsequent calls

onScrollBeyond Options

buffer (default: 20)
The number of pixels below the element that need to be scrolled beyond in order for the event to fire. For example, setting this to zero means that as soon as the bottom of the element can be seen in the window, the callback will fire.
fireOnBeyondElement (default: true)
Whether or not to fire the callback event when the element is scrolled beyond. The alternative is to fire the event only if the very end of the document has been reached (i.e. the user’s scrollbar cannot go any farther down).
fireOnDocEnd (default: true)
If true, the callback event will fire if the user scrolls to the very bottom of the window. Note that if your buffer is greater than zero and your scollBeyond element is the last element on the page, the callback won’t fire unless this is set to true.

onScrollBeyond API

disable
disable the onScrollBeyond for an element by calling jQuery(‘#my_element’).onScrollBeyond(‘disable’)
enable
enable the onScrollBeyond for an element (if it has been disabled) by calling jQuery(‘#my_element’).onScrollBeyond(‘enable’)

onScrollBeyond Example

jQuery(document).ready(
       function() {

         jQuery('div.mydiv').onScrollBeyond(

           function() {
               alert( 'you have scrolled beyond this element' );
           }

         );

       }

   );

scrollExtend Options

buffer (default: 20)
(this option is passed directly to onScrollBeyond. See description above)
fireOnBeyondElement (default: true)
(this option is passed directly to onScrollBeyond. See description above)
fireOnDocEnd (default: true)
(this option is passed directly to onScrollBeyond. See description above)
url
The url that will be loaded via AJAX when a user scrolls beyond the element or hits the end of the page
beforeStart
a callback to be run prior to firing the onScrollBeyond event. Note that this callback MUST RETURN TRUE if you want the event to fire. If this callback returns false, the scroll event will not fire
onSuccess
a callback to be run after the new element has been loaded & appended
target
specifies which element we should append our newly created element to. Accepts any valid jQuery selector.
loadingIndicatorEnabled (default:true)
if true, when content is being loaded, a loading indicator element is added to the target.
loadingIndicatorClass (default: ’scrollExtend-loading’)
Class to be applied to the loading indicator
newElementClass
Class to be applied to the newly created element
ajaxSettings
options to be passed directly to jQuery.ajax().
Note:

  • The URL option will not be respected here; add the url to the main scrollExtend options
  • scrollExtend uses the ’success’ callback, so it is not recommended that you override it. Use scrollExtend’s ‘onSuccess’ callback instead.

scrollExtend API

disable
disable the scrollExtend for an element by calling jQuery(‘#my_element’).scrollExtend(‘disable’)
enable
enable the scrollExtend for an element (if it has been disabled) by calling jQuery(‘#my_element’).scrollExtend(‘enable’)

scrollExtend Example

	jQuery(document).ready(
		function() {
			jQuery('.scroll_container').scrollExtend(
				{
					'target': 'div#scroll_items',
					'url': 'more_content.html',
					'newElementClass': 'list_item more_content'

				}
			);
		}
	);

A quick review of Raven SEO tools

Saturday, October 3rd, 2009

We signed up for Raven a few months ago, although I have to admit that we didn’t really start digging into its features until recently. After working with it in a bit more detail, I thought I’d give a quick run through of what we’ve found so far.

For those who don’t know what it is, Raven is a web-based application for managing Internet Marketing campaigns. It’s a hosted solution, so there’s nothing to install, and it is either $79/month or $199/month depending on the number of users you’ll need. It has a whole host of features that you can check out on their website, but the three I’ll go over here are the SERP tracker, Link Manager, and Social Media manager.

SERP Tracker

Trending forPhiladelphia SEO Firm

Trending for Philadelphia SEO Firm

Initially, we weren’t too impressed with the SERP tracker in raven, but we found that it’s important to let it run for a few weeks before you can really see the value here. You don’t get immediate results the way you do with a local application like WebCEO, but I’ve come to really like Raven’t SERP tracker, especially since it supports graphing of SERP history (pictured left)

Link Manager

Raven Link Manager


Another feature we’ve been utilizing in Raven is the Link Manager, which provides a handy way to keep track of all the inbound links you’ve acquired or requested. It also has link monitoring so that it will let you know when a requested link becomes active, or if an active link becomes inactive.

Social Media Manager

Twitter Account Tracker

Twitter Account Tracker


This is a feature we just started delving into, but it’s pretty cool. Raven allows you to manage “personas”, which are accounts on social media sites that you’ve created for your clients. Especially interesting is the Twitter account manager, which provides a concise report of Twitter “key performance indicators”, including ReTweets and followers (the image to the left was taken from the user manual). Raven also allows you to perform brand management by tracking mentions of your client’s name – kind of like a Google alerts for social media – but admittedly we haven’t really investigated this feature too much.

Conclusion

So far, we’re digging Raven as a campaign management tool. We’re currently using it on the $79/month plan, which is a pretty reasonable price for what you get, though I do think that they could stand to give more than two user accounts at that price. We don’t have any relationship with Raven whatsoever, so this isn’t supposed to be a promotional post, I just thought I’d post some thoughts after using the package.