Skip to content

Instantly share code, notes, and snippets.

@flumono
Last active September 17, 2017 00:24
Show Gist options
  • Save flumono/dad7c7e2f3d566780627b8684472d2d4 to your computer and use it in GitHub Desktop.
Save flumono/dad7c7e2f3d566780627b8684472d2d4 to your computer and use it in GitHub Desktop.
Подробнее = Скрыть (текст)
<div>
<script language="javascript" type="text/javascript">
function popUp($id){
$div=document.getElementById($id);
if ($div.style.display=='none') $div.style.display='block';
else $div.style.display='none';
}
function show_more(){
document.getElementById('show_more').style.display='none';
}
function hide_more(){
document.getElementById('show_more').style.display='block';
}
</script>
<!-- Превью текст -->
<a href="javascript:popUp('show_text')" id="show_more" onclick="show_more();" style="cursor: pointer; color: #D19E44"><br />
<b>Подробнее...</b></a>
<div id="show_text">
<!-- скрытый текст -->
<a href="javascript:popUp('show_text')" onclick="hide_more();" style="cursor: pointer; color: #D19E44">
<b>Скрыть</b>
</a>
</div>
<script language="javascript" type="text/javascript">
popUp('show_text'); </script>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment