Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-15-2009, 07:29 PM   PM User | #1
saltarella
New Coder

 
Join Date: Nov 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
saltarella is an unknown quantity at this point
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
saltarella is offline   Reply With Quote
Old 10-15-2009, 07:44 PM   PM User | #2
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,687
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
Are you talking about using Javascript to scroll the window? Try the scrollto method.

http://www.w3schools.com/jsref/met_win_scrollto.asp
__________________
Fumigator is offline   Reply With Quote
Old 10-15-2009, 07:50 PM   PM User | #3
saltarella
New Coder

 
Join Date: Nov 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
saltarella is an unknown quantity at this point
does it work also to scroll the content of a DIV only?
saltarella is offline   Reply With Quote
Old 10-15-2009, 07:53 PM   PM User | #4
saltarella
New Coder

 
Join Date: Nov 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
saltarella is an unknown quantity at this point
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 ...
saltarella is offline   Reply With Quote
Old 10-15-2009, 08:13 PM   PM User | #5
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,687
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
Quote:
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.
__________________
Fumigator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:31 AM.


Advertisement
Log in to turn off these ads.