Re: Newbie jQuery Question: Ajax Load Callbacks/Using jQuery with Other jLibs?



Thanks very much for this good advice, David.

Have you tried debugging this?


function ScrollToDiv(theDivID)
{
$("html,body").animate({ scrollTop: $("#"+theDivID).offset().top });
}

I got that code from a posting on a forum, and it may very well have
bugs in it. It seems to be working now. I got it all working like so:

function ScrollToDiv(theDivID)
{
$("html,body").animate({ scrollTop: $("#"+theDivID).offset().top });
}

$(document).ready(function(){

$("#HelpInfo").click(function(){
var htmlStr = $(this).html();

$("#HelpInfo").load("http://localhost:8888/index.php/your_plan/HelpInfo";,
{contents: htmlStr}, function(){ ScrollToDiv("HelpInfo")});
});
});


Why not just set the location hash to test it? Then you will know the
callback worked.

I appreciate this - because it gives me something to learn about. I
don't even know what a location hash is yet. :)

What does it mean to scroll both the html and body
elements?

Good question - I'll look into it.

Does jQuery even support animated scrolling?

It does!

jQuery and Prototype and Scriptaculous? Whave are you up to in terms
of script weight? About 200K?

You're quite right. I'll make things work with just one library.
.



Relevant Pages

  • Re: Newbie jQuery Question: Ajax Load Callbacks/Using jQuery with Other jLibs?
    ... I got that code from a posting on a forum, and it may very well have ... bugs in it. ... I'd be very careful about setting the location hash. ...
    (comp.lang.javascript)
  • Re: Hi Folks, Pmb is back! :)
    ... I the past 8-9 years of posting on the web I've ... What I mentioned above works quite well in a moderated forum. ... Please, call me Pete. ... | create a web site with the basics of the physics and math on it. ...
    (sci.physics.relativity)
  • Re: Hi Folks, Pmb is back! :)
    ... I the past 8-9 years of posting on the web I've ... What I mentioned above works quite well in a moderated forum. ... Please, call me Pete. ... | create a web site with the basics of the physics and math on it. ...
    (sci.physics.relativity)
  • Re: Hi Folks, Pmb is back! :)
    ... I the past 8-9 years of posting on the web I've ... What I mentioned above works quite well in a moderated forum. ... Please, call me Pete. ... | create a web site with the basics of the physics and math on it. ...
    (sci.physics.relativity)
  • Re: Well, they went and did it.
    ... I know of no group but this one where some people use bottom posting. ... Top posting makes more sense in the corporate environment where people routinely deal with 80 to 150 or more interdepartmental emails per day. ... To each his own, I suppose, but if it is an agreed upon convention for this forum, I'll see if I can accommodate it. ...
    (alt.smokers.pipes)