How to hide Amazon webstore default toolbar with Prototype?
after playing around this morning, i've found that there's this default chunk of html code in the amazon webstore which will add a toolbar on top of the page. the html looks like below:
<td id="wba_logo_bg">
<table class="logo" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr><td align="left"></td>
<td class="wba_account" style="padding: 5px;" align="right" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<form action="#" id="searchForm" method="get" name="searchForm"></form>
<tbody><tr><td class="wba_account_link">
<a xmlns:xhtml="http://www.w3.org/1999/xhtml" class="myAccountNav" href="#" onclick="return false;">home</a></td>
<td class="myAccountDots"></td>
<td class="wba_account_link"><a class="myAccountNav" href="#" onclick="return false;">view cart</a></td>
<td class="myAccountDots"></td><td class="wba_account_link"><a class="myAccountNav" href="#" onclick="return false;">my account</a><开发者_开发百科/td>
<td class="myAccountDots"></td><td class="wba_account_link"><a class="myAccountNav" href="#" onclick="return false;">order status</a></td>
<td><img src="pageEditor_files/1_pixel.gif" hspace="7"></td>
<td><input name="keyword" tabindex="1" type="text"></td>
<td><img alt="Search" class="wba_search_btn" onclick="return false;" onkeyup="if (13==event.keyCode) searchForm.submit();"
src="pageEditor_files/btn_search.gif" style="cursor: pointer;" tabindex="2" title="Search" hspace="3">
</td></tr></tbody>
</table>
</td></tr></tbody>
</table>
</td>
and thus far i was able to use prototype to find those with the class name of wba_account_link and hide them via the codes below:
function hideAmazonToolbar()
{
$("#wba_logo_bg").hide();
}//end function
but what i really want to do is preferably to hide the whole tbody instead, but with my limited prototype skills, i don't really know how to do this. can anybody point me to the right resources on how to get this done?
EDIT
Went higher up and apparently there's a td with an id, and solve it using prototype hide function! man, i love javascript framework :)
You want the up
function. I think this should do it.
document.getElementsByClassName('wba_account_link').up('tbody');
精彩评论