onclick jump's to the top of the page (need to stop this)
<body onload="init();">
<center>
<form id="selector">
<select id="book" onchange="initChapSelector();"></select>
<select id="chap" onchange="initPageSelector();"></select>
<select id="page" onchange="initDisplay();"></select>
<select id="scale" onchange="setScale(this.options[this.selectedIndex].value);">
<option value="">Original Width</option>
<option value="100%">Page Width</option>
<option value="50%">Half Page</option>
</select>
<a href="javascript:void(0)" onclick="alert('Arrow up/down: scroll\nArrow left/right: prev/next page'); return false;">Help</a>
</form>
<a href="javascript:void(0)" onclick="moveToNextPage(); return false;"> <img id="display" style="max-width:100%" src="./js/VKmanga/spinner.gif"></a>
</center>
</body>
This is my code and on everyclick my manga viewer jumps to the top You can see it live http://dev.animelon.com/m开发者_JAVA技巧anga/
Ive tryed href="#"
and a few other ways nothing seems to work
Thanks
According to firebug, your initDisplay
function (view.js line 215), you have the line window.scroll(0, 0);
. This is obviously what is causing the browser to scroll to the top ;-)
<a href="#" onclick="return false;">Link</a>
or
<a href="#" onclick="(function(e){e.preventDefault()/*do something here */}); return false;">Link</a>
精彩评论