hi there,
I try to use a link out of a view to jump within the panel..

...
<a class="active" href="/de/node/5/blog/1#node-702"><Link</a>

It not not working with one click, I need TWO!!!? the first click brings the anchor to url/reloads the page and the second click jumps.. What could be the cause of this?

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

The behavior suggests the actual URL in the tag is not the URL the page is on? I don't know why this would be but I don't see how this is related to Panels.

Apfel007’s picture

Status: Closed (won't fix) » Active

sorry for reopen, but the url is the same like the panel page... only with an anchor
Do you have any idea why this happen.. first click page reload - second click jump to anchor point?

vomitHatSteve’s picture

This probably isn't a panels issue per se, but this is the only place I've managed to find where this specific question is being addressed, so maybe it'll be answered here?

I have the exact same problem with some custom code I'm working on.

The first click reloads the page. The second jumps to the anchor.

I've tested this on Firefox, IE, and Chrome. What could be causing this?

Edit:
Until I can find an actual fix, here's a klugey workaround I figured out.

assuming we have a an anchor named "anchor" somewhere, we create our link like so

l(
  'text', 
  preg_replace('!^/!', '', request_uri()), // link back to this page without leading '/'
  array(
    'attributes' => array('id' => 'jump_link'),
    'fragment' => 'anchor',
    'absolute' => TRUE,
  )
)
.'<script type="text/javascript">'."\n"
.'  document.getElementById("jump_link").onclick = function () {'."\n"
.'    window.location.hash="anchor";'."\n"
.'  }'."\n"
.'</script>';
munti’s picture

Hi! I had the same problem, but none of the solutions i read worked.

I solved the problem with javascript:
<a href="javascript:document.getElementById('myid').scrollIntoView(true);">link</A>

japerry’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

good. marking what is in d6 as fine then.