1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Top Button Help

Discussion in 'Styling and Customization Questions' started by Matthew2D, Jan 1, 2012.

  1. Matthew2D

    Matthew2D Active Member

    When I hit the top button at the bottom, I want to to scroll to the top. Anybody have any idea how to do that?

    Thanks!
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> footer

    Change the red piece:

    Code:
    			<ul class="footerLinks">
    			<xen:hook name="footer_links">
    				<xen:if is="{$xenOptions.contactUrl.type} === 'default'">
    					<li><a href="{xen:link 'misc/contact'}" class="OverlayTrigger" data-overlayOptions="{&quot;fixed&quot;:false}">{xen:phrase contact_us}</a></li>
    				<xen:elseif is="{$xenOptions.contactUrl.type} === 'custom'" />
    					<li><a href="{$xenOptions.contactUrl.custom}" {xen:if {$xenOptions.contactUrl.overlay}, 'class="OverlayTrigger" data-overlayOptions="{&quot;fixed&quot;:false}"'}>{xen:phrase contact_us}</a></li>
    				</xen:if>
    				<xen:if is="{$homeLink}"><li><a href="{$homeLink}">{xen:phrase home}</a></li></xen:if>
    				<li><a href="{$requestPaths.requestUri}#navigation">{xen:phrase go_to_top}</a></li>
    				<li><a href="{xen:link forums/-/index.rss}" rel="alternate" class="globalFeed" target="_blank"
    					title="{xen:phrase rss_feed_for_x, 'title={$xenOptions.boardTitle}'}">{xen:phrase rss}</a></li>
    			</xen:hook>
    			</ul>
    
    Like so:

    Code:
    			<ul class="footerLinks">
    			<xen:hook name="footer_links">
    				<xen:if is="{$xenOptions.contactUrl.type} === 'default'">
    					<li><a href="{xen:link 'misc/contact'}" class="OverlayTrigger" data-overlayOptions="{&quot;fixed&quot;:false}">{xen:phrase contact_us}</a></li>
    				<xen:elseif is="{$xenOptions.contactUrl.type} === 'custom'" />
    					<li><a href="{$xenOptions.contactUrl.custom}" {xen:if {$xenOptions.contactUrl.overlay}, 'class="OverlayTrigger" data-overlayOptions="{&quot;fixed&quot;:false}"'}>{xen:phrase contact_us}</a></li>
    				</xen:if>
    				<xen:if is="{$homeLink}"><li><a href="{$homeLink}">{xen:phrase home}</a></li></xen:if>
    				<li><a href="{$requestPaths.requestUri}#headerMover">{xen:phrase go_to_top}</a></li>
    				<li><a href="{xen:link forums/-/index.rss}" rel="alternate" class="globalFeed" target="_blank"
    					title="{xen:phrase rss_feed_for_x, 'title={$xenOptions.boardTitle}'}">{xen:phrase rss}</a></li>
    			</xen:hook>
    			</ul>
    
    That will anchor to the header area which is the very top of the page for most users (unless there is a moderator bar or login bar present).

    Or you can use javascript. Add the red code:

    Code:
    			<ul class="footerLinks">
    			<xen:hook name="footer_links">
    				<xen:if is="{$xenOptions.contactUrl.type} === 'default'">
    					<li><a href="{xen:link 'misc/contact'}" class="OverlayTrigger" data-overlayOptions="{&quot;fixed&quot;:false}">{xen:phrase contact_us}</a></li>
    				<xen:elseif is="{$xenOptions.contactUrl.type} === 'custom'" />
    					<li><a href="{$xenOptions.contactUrl.custom}" {xen:if {$xenOptions.contactUrl.overlay}, 'class="OverlayTrigger" data-overlayOptions="{&quot;fixed&quot;:false}"'}>{xen:phrase contact_us}</a></li>
    				</xen:if>
    				<xen:if is="{$homeLink}"><li><a href="{$homeLink}">{xen:phrase home}</a></li></xen:if>
    				<li><a href="{$requestPaths.requestUri}#navigation" onclick="self.scrollTo(0, 0); return false;">{xen:phrase go_to_top}</a></li>
    				<li><a href="{xen:link forums/-/index.rss}" rel="alternate" class="globalFeed" target="_blank"
    					title="{xen:phrase rss_feed_for_x, 'title={$xenOptions.boardTitle}'}">{xen:phrase rss}</a></li>
    			</xen:hook>
    			</ul>
    
     

Share This Page