Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrolling problem with show/hide div 1

Status
Not open for further replies.

ColdPhreze

Programmer
Apr 15, 2002
93
See this website:
When you click a link under services & solutions or Diagnostics & repairs, a Div appears with more info.

The problem is if you scroll down the page and click one of the links, the page will scroll back to the top. I have implemented window.scrollTo() but the page still scrolls to the top. It also scrolls to the top if you close the div.

It's driving me crazy, please help!
 
Hi

Just [tt]return[/tt] [tt]false[/tt] from the event handlers :
Code:
<a href="#" onClick="hideMoreInfo();[red]return false[/red]" onMouseOver="brightCloseBtn();" onMouseOut="dimCloseBtn();"><img id="closebtn" src="images/closebtn.jpg">

<a href="#" class="text" onClick="showMoreInfo(this.innerHTML, DetailedDescription['OnSite']);[red]return false[/red]">On-site Service - NO additional charge!</a>
See Early event handlers | Prevent default by Peter-Paul Koch.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top