Jump to content

bibo

Newbie
  • Posts

    2
  • Joined

  • Last visited

bibo's Achievements

Explorer

Explorer (1/14)

0

Reputation

  1. Вот собственно сам пример HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /> <title>Test jQuery</title> <link href="css/style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> function showhideBlock(idclick,idtext){ var objclick = document.getElementById(idclick); var objtext = document.getElementById(idtext); if(objtext.style.visibility=='hidden') { objclick.innerHTML=objclick.innerHTML.replace("DIV On","DIV Off"); objtext.style.visibility='visible'; } else { objclick.innerHTML=objclick.innerHTML.replace("DIV Off","DIV On"); objtext.style.visibility='hidden'; } } </script> </head> <body> <a href="#" id="switch" onclick="showhideBlock('switch','hide');">DIV On</a> <div id="hide" style="visibility: hidden;"> <div style="height:40px; width:200px; background:#FC0;"></div> </div> </body> </html>
  2. Помогите пожалуйста прикрутить эффекты .fadeIn() и .fadeOut(), вот к этому скрипту(другие, в моем случае просто не работают, а эффект нужен), впрочем не откажусь от других вариантов с применением "visibility". <script> function showhideBlock(idclick,idtext){ var objclick = document.getElementById(idclick); var objtext = document.getElementById(idtext); if(objtext.style.visibility=='hidden') { objclick.innerHTML=objclick.innerHTML.replace("Show","Hide"); objtext.style.visibility='visible'; } else { objclick.innerHTML=objclick.innerHTML.replace("Hide","Show"); objtext.style.visibility='hidden'; } } </script>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy