jquery--点击后滑动展开或关闭DIV层

<p>jquery--点击后滑动展开或关闭DIV层<br /> jQuery Collapse -这个jQuery插件同样点击后滑动展开或关闭DIV层<br /> 代码如下:</p> <p><br /> <br /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></p> <p><br /> <title></title> <br /> <script type="text/javascript" src="jquery.js"></script><br /> <script type="text/javascript"><br /> $(function()<br /> {<br /> $("#mostrar").click(function(event) {<br /> event.preventDefault();<br /> $("#caja").slideToggle();<br /> });<br /> $("#caja a").click(function(event) {<br /> event.preventDefault();<br /> $("#caja").slideUp();<br /> });<br /> });<br /> </script><br /> <style type="text/css"><br /> body {<br /> font-family: Verdana, Arial, Helvetica, sans-serif;<br /> font-size: 11px;<br /> color: #666666; <br /> }<br /> a{color:#993300; text-decoration:none;}<br /> #caja {<br /> width:70%;<br /> display: none;<br /> padding:5px;<br /> border:2px solid #FADDA9;<br /> background-color:#FDF4E1;<br /> }<br /> #mostrar{<br /> display:block;<br /> width:70%;<br /> padding:5px;<br /> border:2px solid #D0E8F4;<br /> background-color:#ECF8FD;<br /> }<br /> </style> <br /> <br /> </p> <p><br /> <a href="#" id="mostrar">MOSTRAR</a></p> <p></p> <p></p> <div id="caja"><br /> <a class="close" href="#">[x]</a> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren</p> </div> <p> <p></p> </p>
RangeTime:0.008840s
RangeMem:205.35 KB
返回顶部 留言