Results 1 to 6 of 6

Thread: gAjax pausing script scroller guidance

  1. #1
    Join Date
    Mar 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default gAjax pausing script scroller guidance

    1) Script Title: gAjax pausing script scroller

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...sescroller.htm

    3) Describe problem: The script works fine in my news.php module stand alone, however, when it gets loaded from my index.php when selected from the menu, the scrolling functionality is not there. I'm fairly sure it has to do with the timing of loading events. Any input would be appreciated.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Please post a link to the page on your site that contains the problematic script so we can check it out.
    DD Admin

  3. #3
    Join Date
    Mar 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    My site is located at http://stephendowell.net. Index.php loads /portal/news.php when selected from the menu. The loaded module contains it's own scripts which seem to work fine stand alone, however, doesn't function when loaded from the index.php module.

    Thanks for any input and let me know what else I can provide to help.
    Last edited by steadwell; 07-22-2010 at 12:04 PM.

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The problem is due to the fact that you're loading "news.php" using Ajax. Pages fetched via Ajax should they contain JavaScripts within it in many cases won't run correctly when brought over this way. Ajax basically copies the contents of the external file similar to copying plain text and just dumps it onto the main page. Browsers don't know to interpret scripts or even CSS (in IE) within that copied content.

    A workaround you can try is to use an IFRAME to show "news.php" instead. Try creating a blank page with just an IFRAME tag, ie:

    Code:
    <iframe src="http://stephendowell.net/portal/news.php" style="width:100%;height:400px"></iframe>
    and save it as say "newscontainer.php". Then, change the href attribute of the news link to point to this page instead, which when called will insert the IFRAME onto your main page, in turn displaying "news.php". Untested, but should work.
    DD Admin

  5. #5
    Join Date
    Mar 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Your suggestion has given me some ideas about alternative approaches. When I tried your advice as stated, the script functions fine but it displays only the referenced module (newscontainer.php) in a new window instead of displaying the news page within the index page. I appreciate your feedback and will continue tinkering with this. Also, any other ideas are surely welcome.
    Thanks!

  6. #6
    Join Date
    Mar 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks to your suggestion, I've got this working pretty well.

    Thanks For Your Input!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •