Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Nov 2008
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    loading external html in a DIV question

    Hi everybody,
    I´m loading a div of an external html (#right_in) into a div (#right) in my main movie this way:

    Code:
    var toLoad = divobj.id+'.html #right_in';
    
    function loadContent() {
    $('#right').load(toLoad);
    showNewContent();
    }
    function showNewContent() {
    $('#right').fadeIn(800);
    }

    Is it possible to specify that the DIV has to load always at y=0, ie from the top?
    Because when I load another external div into my main div firefox keeps the latest position (if I scrolled before it loads the new page at that point).

    Any help is very appreciated!
    Thanks in advance

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Are you talking about using Javascript to scroll the window? Try the scrollto method.

    http://www.w3schools.com/jsref/met_win_scrollto.asp

  • #3
    New Coder
    Join Date
    Nov 2008
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    does it work also to scroll the content of a DIV only?

  • #4
    New Coder
    Join Date
    Nov 2008
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I try to explain it better: since you can scroll the container DIV (#right), when you scroll it and stop at 1/3 and than click the button that loads another DIV into #right firefox loads the next DIV also at 1/3. Do you know what I mean?

    I also have an anchor called "1" at the top of each external html, but it doesn´t seem to work to simply add #1

    var toLoad = divobj.id+'.html#1 #right_in';

    I was hoping is just a syntax mistake ...

  • #5
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    when you scroll it and stop at 1/3 and than click the button that loads another DIV into #right firefox loads the next DIV also at 1/3.
    Interesting... I suppose if you remove the div you're loading, then recreate it, the scroll position will reset.


  •  

    Posting Permissions

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