You can do it in the normal manner by making a link - say:
Code:
<a href="#" rel="paragraph-B" parent="scrollcontent1" onClick="return false">Go to Paragraph B within Demo #1</a>
If you like you can hide it:
Code:
<a style="display: none;" href="#" rel="paragraph-B" parent="scrollcontent1" onClick="return false">Go to Paragraph B within Demo #1</a>
Then here in the head of the page, in the init, add the highlighted:
Code:
$( document ).ready( function() {
$( "div[rel='scrollcontent1']" ).customscroll( { direction: "vertical" } );
$( "div[rel='scrollcontent2']" ).customscroll( { direction: "horizontal", bounce:0 } );
$('[rel=paragraph-B]').trigger('click');
});
Or if you want to activate a given paragraph via a link from another page. Say the page with scroller on it is scroller.htm - then keep the on page link, hidden or shown, use this as the init:
Code:
$( document ).ready( function() {
$( "div[rel='scrollcontent1']" ).customscroll( { direction: "vertical" } );
$( "div[rel='scrollcontent2']" ).customscroll( { direction: "horizontal", bounce:0 } );
var m = /[?&;]rel=([^&;#]*)/.exec(location.search);
m? $('[rel=' + unescape(m[1]) + ']').trigger('click') : null;
});
And the link on the other page would be:
Code:
<a href="scroller.htm?rel=paragraph-B">Go to B on the Scroller Page</a>
Bookmarks