Difference between revisions of "Template:Find an article"
From NSWiki
(change text) |
|||
Line 1: | Line 1: | ||
− | + | <script> | |
function showDivArticle() { | function showDivArticle() { | ||
if ($('#article:hidden').length > 0) { | if ($('#article:hidden').length > 0) { | ||
Line 19: | Line 19: | ||
} | } | ||
</script> | </script> | ||
− | <div style="border-width: 0px; border-style: solid; border-radius: 3px; background-color:#white; box-shadow: 0px 4px 10px #999999; align:center; width:80%; text-align: center; padding: 3ex 3ex; margin-top: 1em; margin-bottom: 1em; margin-left: 1em; margin-right: 1em;" | + | <div style="border-width: 0px; border-style: solid; border-radius: 3px; background-color:#white; box-shadow: 0px 4px 10px #999999; align:center; width:80%; text-align: center; padding: 3ex 3ex; margin-top: 1em; margin-bottom: 1em; margin-left: 1em; margin-right: 1em;"> |
− | <input type="button" name="article" value=" | + | <input type="button" name="article" value="Search The Wiki" onclick="showDivArticle()" class="btn btn-default btn-lg btn-block"/><div id="article" style="display: none;"><input type="text" id= "articleinput" placeholder="article" style="width: 95%; border:0px solid; border-radius: 3px; border:0px solid; box-shadow: 0px 2px 10px #999999; margin-top: 10px; text-align: center; padding: 5px 5px;" onkeydown="return pressArticle( event );"></input></div></div> |
− | + |
Revision as of 21:55, 22 January 2014
<script> function showDivArticle() {
if ($('#article:hidden').length > 0) { $('#article').slideDown('medium'); $('#articleinput').focus(); $('#articleinput').select(); } else { searchArticle(); }
} function pressArticle(e) {
var evt = e || window.event if (evt.keyCode === 13) { searchArticle(); }
} function searchArticle() {
window.location.href = "http://nswiki.org/index.php?search=" + $("#articleinput").val();
} </script>
<input type="button" name="article" value="Search The Wiki" onclick="showDivArticle()" class="btn btn-default btn-lg btn-block"/>