sitemap  |  contact

Sakic.Net Forum
07 January 2009, 21:15 *
Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length
News: Introducing AJAX Scroller - Joomla News Slider Module: http://www.sakic.net/news/introducing_ajax_scroller/
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: how can i set up an anchor  (Read 996 times)
Smylo
Newbie
*
Posts: 6


View Profile
« on: 02 April 2007, 01:08 »

Hallo all,

i tryed a lot of things, but nothing worked for my satisfaction...
I want an anchor on the top of every page and a link button at the bottom to get every time as fast as possible from the bottom to the top without scrolling.
If i make a normal anchor and you click on the button you are redirected to my frontpage, so i tryed some thing with other button-code (link to anchor) and at the moment i used this code:
Code:
<a href="<?php echo sefRelToAbs($_SERVER['REQUEST_URI'])."#oben"?>"><?php echo '<img src="' .$mosConfig_live_site'/templates/' .$GLOBALS['cur_template']. '/images/nachoben.gif" alt="nach oben" width="70" title="zum Anfang der Seite..." height="21" border="0"/>'?></a>

this seems to be working, if you now click on the button you will be redirected to the top of the page, but the address changed to a normal content link without any SEF optimization...

I hope anyone can help me out with this problem
Thanks
Smylo
« Last Edit: 02 April 2007, 10:41 by Saka » Logged
Saka
Administrator
Hero Member
*****
Posts: 1,351


View Profile WWW
« Reply #1 on: 02 April 2007, 10:42 »

Hello,

If it's anchor tag within Joomla! content then just use ordinary anchor tags. No additional modifications are needed.

If it is outside content you must use following trick for the link:

Code:
<a href="<?php echo sefRelToAbs(substr($_SERVER['REQUEST_URI'],0)).'#tag'?>">Link</a>


Or if you just want to make a scroll to the top you can use javascript:

Code:
<a href="javascript:scroll(0,0);">

Logged

Pages: [1]
  Print  
 
Jump to: