2013-12-17 184 views
1
<html> 
<head> 
<link rel="stylesheet" href="style.css" type="text/css"> 
<link href="font-awesome.css" rel="stylesheet"> 

</head> 
<body leftmargin="0px" topmargin="0px" > 
<div class="header"> 
    <div class="head"><div class="logo"><img src="logo.png"></div> 
     <div class="menu"><a href="#main" >menu</a></div> 
</div> 
    <div id="main"> 
    <section id="nav"> 
     <ul><li><a href="#">Home</a></li> 
     <li><a href="#new">Events</a></li> 
     <li><a href="#tech">Technical</a></li> 
     <li><a href="#">Schedule</a></li> 
     <li><a href="#">Contact</a></li> 
     </ul> 
    </section> 
    <div id="new"><h1 align="center">Content changed</h1></div> 
    <div id="tech"><h1 align="center">Technical event</h1></div> 
</div><br> 
</body> 
</html> 

我想停止跳轉到ID =「主」時,點擊並要停止所有錨#NEW鏈接停止滾動,並跳轉頁面應該留下,因爲它是停止錨滾動點擊

回答

0

我想你是附加事件監聽器的鏈接。這是我想出了使用代碼的例子:http://jsfiddle.net/Rdsxk/

$(selector).on('click', function(){ 
//add code you want to execute here 
return false 
}); 

Selector將是類你不想滾動的鏈接。