Connecting Tech Pros Worldwide Help | Site Map

Using .load() to load a dynamic/animated element

Newbie
 
Join Date: Jun 2007
Posts: 26
#1: Jul 26 '09
I have seen many examples on how to use the .load() function to load in static elements, but I am trying to load a dynamic element, specifically a scrollable.

I have gotten it to the point where:

1) the scrollable will function if I directly view PageToLoad.asp in the broswer.

2) the static elements of the scrollable will load onto MainPage.asp. (i.e., it looks right)

3) the scrollable does not function as loaded on to MainPage.asp.

I assume that my javascript is somehow incorrect in how I'm loading PageToLoad.asp, but I can't figure out why.

I have the function that makes the scrollable run on PageToLoad.asp (here is a small selection of it):

Expand|Select|Wrap|Line Numbers
  1. $(document).ready(function() {    
  2.     var api = $("div.scrollable").scrollable({
  3.         size: 7,
  4.         api: true
  5. });
And all I have on MainPage.asp is:

Expand|Select|Wrap|Line Numbers
  1. $(document).ready(function() {    
  2.     $('#scrollableC').load('PageToLoad.asp');        
  3. });
I also import the "include" files into both MainPage.asp and PageToLoad.asp:

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" src="subroutines.js"></script>
  2. <script type="text/javascript" src="jQuery/jquery-1.3.2.js"></script>
  3. <script type="text/javascript" src="jQuery/jquery.tools.min.js"></script>
As well as my css files.

How can I get the scrollable to animate when it is loaded?

Than you for any and all ideas.
Reply

Tags
.load()