Auto scroll to an anchor inside a cfdiv


I have a CFDIV

<cfdiv name="test">
<a name="top">TOP</a>
<div style="height:5000px;">container</div>
<a name="bottom">BOTTOM</a>

I need to scroll to the anchor #bottom when i click on a link.

Please Help

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Use : <a name="bottom" id="bottom">BOTTOM</a>

and add : #bottom to your link
quarkmikeAuthor Commented:
Thanks Leakim but i need to post value inside cfdiv and go to the anchor (bas) without refreshing the entire page .


<cfdiv id="mike" style="width:100px; height:200px; overflow:hidden;" ></cfdiv>

<a onClick="ColdFusion.navigate('div.cfm?testValue=1','mike');">a</a>


<cfparam name="testValue" default="0">
<div style="height:500px;background-color:red;"><cfoutput>#now()#</cfoutput></div>
<a name="bas" id="bas">#testValue#</a>
Did you tried this?
<a onClick="ColdFusion.navigate('div.cfm?testValue=1#bas','mike');">a</a>
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

quarkmikeAuthor Commented:
Rodrigo MuneraSr. Software EngineerCommented:
<a href="#bottom" onClick="ColdFusion.navigate('div.cfm?testValue=1','mike');">Go to bottom</a>

Open in new window

quarkmikeAuthor Commented:
Don't work :/
Please provide a link to see that in live! Thanks :)
quarkmikeAuthor Commented:

<cfdiv id="testDiv" style="width:100px; height:200px; overflow:scroll;" ></cfdiv>

<a href="#bottom" onClick="ColdFusion.navigate('div.cfm?testValue=1','testDiv');">Go to bottom</a>

<cfparam name="testValue" default="0">
<div style="height:500px;background-color:red;"><cfoutput>#now()#</cfoutput></div>
<cfoutput><a name="bottom" id="bottom">#testValue#</a></cfoutput>
Using the callback function :

Work for me :
<a href="#bottom" onclick="ColdFusion.navigate('div.cfm?testValue=1','testDiv',function() { location.hash = '#';setTimeout(function() { location.hash = '#bottom'; },100); });return false;">Go to bottom</a>

Open in new window

This get the first link in the page : document.getElementsByTagName("a")[0]

document.getElementsByTagName("a")[0].onclick = function() {
	ColdFusion.navigate('div.cfm?testValue=1','testDiv',function() { 
		location.hash = "#";
		setTimeout(function() {
			location.hash = "#bottom";
	return false;

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
quarkmikeAuthor Commented:
Thanks guys
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.