这个脚本只适用于firefox和chrome,它给了我这个错误:
Uncaught TypeError: Cannot call method 'substring' of undefined
<script type="text/javascript">
function hidediv()
{
document.getElementById('divright').style.display = 'none';
document.getElementById('divleft').style.margin = "0 auto";
document.getElementById('divleft').style.cssFloat = "none";
}
function showdiv()
{
document.getElementById('divright').style.display = 'block';
document.getElementById('divleft').style.cssFloat = "left";
}
</script>
<div class="right_links">
<nav class="reader_nav"><!-- html5 nav tag -->
<span class="content" id="show4" onmouseover="tooltip.show('Content', 300);" onmouseout="tooltip.hide();" ></span>
<span id="show5" class="prefrance" onmouseover="tooltip.show('Settings', 250);" onmouseout="tooltip.hide();" ></span>
<span id="show" class="search" onmouseover="tooltip.show('Search', 210);" onmouseout="tooltip.hide();"></span>
<span id="show2" class="about" onmouseover="tooltip.show('About this book', 204);" onmouseout="tooltip.hide();"></span>
<span id="show3" class="help" onmouseover="tooltip.show('Help', 120);" onmouseout="tooltip.hide();" ></span>
</nav>
</div>
答案 0 :(得分:0)
检查tooltip.show
和tooltip.hide
方法,我的猜测是错误出现在那里,因为你没有在任何地方使用substring方法。