Link to home
Start Free TrialLog in
Avatar of quarkmike
quarkmikeFlag for France

asked on

Auto scroll to an anchor inside a cfdiv

Hi,

I have a CFDIV

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

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

Please Help

Mike
Avatar of leakim971
leakim971
Flag of Guadeloupe image

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

and add : #bottom to your link
https://www.experts-exchange.com/questions/28367507/Auto-scroll-to-an-anchor-inside-a-cfdiv.html#bottom
Avatar of quarkmike

ASKER

Thanks Leakim but i need to post value inside cfdiv and go to the anchor (bas) without refreshing the entire page .

Example

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

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

 -------------------

div.cfm
<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>
Yes.
Mike:
<a href="#bottom" onClick="ColdFusion.navigate('div.cfm?testValue=1','mike');">Go to bottom</a>

Open in new window

Don't work :/
Please provide a link to see that in live! Thanks :)
http://www.cfmike.com/test/test.cfm


test.cfm
<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>

div.cfm
<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>
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks guys