Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/11/2010, 00:38
bkolores
 
Fecha de Ingreso: mayo-2008
Ubicación: Santiago-Chile
Mensajes: 253
Antigüedad: 16 años
Puntos: 1
Respuesta: Complejo Jquery me parte la cabeza HELP

agregue las librerias jquery y jquery.easing.1.3 y la consola de errores dice esto

Jquery is not defined y al hacer click me selecciona eso help
jQuery.easing['jswing'] = jQuery.easing['swing'];


Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <title>Documento sin título</title>
  5.  
  6. ul.sdt_menu{
  7.     margin:0;
  8.     padding:0;
  9.     list-style: none;
  10.     font-family:"Myriad Pro", "Trebuchet MS", sans-serif;
  11.     font-size:14px;
  12.     width:1020px;
  13. }
  14. ul.sdt_menu a{
  15.     text-decoration:none;
  16.     outline:none;
  17. }
  18. ul.sdt_menu li{
  19.     float:left;
  20.     width:170px;
  21.     height:85px;
  22.     position:relative;
  23.     cursor:pointer;
  24. }
  25. ul.sdt_menu li > a{
  26.     position:absolute;
  27.     top:0px;
  28.     left:0px;
  29.     width:170px;
  30.     height:85px;
  31.     z-index:12;
  32.     background:transparent url(http://www.mastercafe.com/ejemplos/slideboxmenu/images/overlay.png) no-repeat bottom right;
  33.     -moz-box-shadow:0px 0px 2px #000 inset;
  34.     -webkit-box-shadow:0px 0px 2px #000 inset;
  35.     box-shadow:0px 0px 2px #000 inset;
  36. }
  37. ul.sdt_menu li a img{
  38.     border:none;
  39.     position:absolute;
  40.     width:0px;
  41.     height:0px;
  42.     bottom:0px;
  43.     left:85px;
  44.     z-index:100;
  45.     -moz-box-shadow:0px 0px 4px #000;
  46.     -webkit-box-shadow:0px 0px 4px #000;
  47.     box-shadow:0px 0px 4px #000;
  48. }
  49. ul.sdt_menu li span.sdt_wrap{
  50.     position:absolute;
  51.     top:25px;
  52.     left:0px;
  53.     width:170px;
  54.     height:60px;
  55.     z-index:15;
  56. }
  57. ul.sdt_menu li span.sdt_active{
  58.     position:absolute;
  59.     background:#111;
  60.     top:85px;
  61.     width:170px;
  62.     height:0px;
  63.     left:0px;
  64.     z-index:14;
  65.     -moz-box-shadow:0px 0px 4px #000 inset;
  66.     -webkit-box-shadow:0px 0px 4px #000 inset;
  67.     box-shadow:0px 0px 4px #000 inset;
  68. }
  69. ul.sdt_menu li span span.sdt_link,
  70. ul.sdt_menu li span span.sdt_descr,
  71. ul.sdt_menu li div.sdt_box a{
  72.     margin-left:15px;
  73.     text-transform:uppercase;
  74.     text-shadow:1px 1px 1px #000;
  75. }
  76. ul.sdt_menu li span span.sdt_link{
  77.     color:#fff;
  78.     font-size:24px;
  79.     float:left;
  80.     clear:both;
  81. }
  82. ul.sdt_menu li span span.sdt_descr{
  83.     color:#0B75AF;
  84.     float:left;
  85.     clear:both;
  86.     width:155px; /*For dumbass IE7*/
  87.     font-size:10px;
  88.     letter-spacing:1px;
  89. }
  90. ul.sdt_menu li div.sdt_box{
  91.     display:block;
  92.     position:absolute;
  93.     width:170px;
  94.     overflow:hidden;
  95.     height:170px;
  96.     top:85px;
  97.     left:0px;
  98.     display:none;
  99.     background:#000;
  100. }
  101. ul.sdt_menu li div.sdt_box a{
  102.     float:left;
  103.     clear:both;
  104.     line-height:30px;
  105.     color:#0B75AF;
  106. }
  107. ul.sdt_menu li div.sdt_box a:first-child{
  108.     margin-top:15px;
  109. }
  110. ul.sdt_menu li div.sdt_box a:hover{
  111.     color:#fff;
  112. }
  113. body { background-color:#000; }
  114.  
  115.  
  116. </head>
  117.  
  118.     <div class="content">
  119.  
  120.             <h1 class="title">Slide Down Box Menu with jQuery and CSS3</h1>
  121.  
  122.             <ul id="sdt_menu" class="sdt_menu">
  123.  
  124.                 <li>
  125.  
  126.                     <a href="#">
  127.  
  128.                         <img src="http://www.mastercafe.com/ejemplos/slideboxmenu/images/2.jpg" alt=""/>
  129.  
  130.                         <span class="sdt_active"></span>
  131.  
  132.                         <span class="sdt_wrap">
  133.  
  134.                             <span class="sdt_link">About me</span>
  135.  
  136.                             <span class="sdt_descr">Get to know me</span>
  137.  
  138.                         </span>
  139.  
  140.                     </a>
  141.  
  142.                 </li>
  143.  
  144.                 <li>
  145.  
  146.                     <a href="#">
  147.  
  148.                         <img src="http://www.mastercafe.com/ejemplos/slideboxmenu/images/1.jpg" alt=""/>
  149.  
  150.                         <span class="sdt_active"></span>
  151.  
  152.                         <span class="sdt_wrap">
  153.  
  154.                             <span class="sdt_link">Portfolio</span>
  155.  
  156.                             <span class="sdt_descr">My work</span>
  157.  
  158.                         </span>
  159.  
  160.                     </a>
  161.  
  162.                     <div class="sdt_box">
  163.  
  164.                             <a href="#">Websites</a>
  165.  
  166.                             <a href="#">Illustrations</a>
  167.  
  168.                             <a href="#">Photography</a>
  169.  
  170.                     </div>
  171.  
  172.                 </li>
  173.  
  174.                 <li>
  175.  
  176.                     <a href="#">
  177.  
  178.                         <img src="http://www.mastercafe.com/ejemplos/slideboxmenu/images/2.jpg" alt=""/>
  179.  
  180.                         <span class="sdt_active"></span>
  181.  
  182.                         <span class="sdt_wrap">
  183.  
  184.                             <span class="sdt_link">Inspiration</span>
  185.  
  186.                             <span class="sdt_descr">Where ideas get born</span>
  187.  
  188.                         </span>
  189.  
  190.                     </a>
  191.  
  192.                 </li>
  193.  
  194.                 <li>
  195.  
  196.                     <a href="#">
  197.  
  198.                         <img src="http://www.mastercafe.com/ejemplos/slideboxmenu/images/4.jpg" alt=""/>
  199.  
  200.                         <span class="sdt_active"></span>
  201.  
  202.                         <span class="sdt_wrap">
  203.  
  204.                             <span class="sdt_link">Photos</span>
  205.  
  206.                             <span class="sdt_descr">I like to photograph</span>
  207.  
  208.                         </span>
  209.  
  210.                     </a>
  211.  
  212.                 </li>
  213.  
  214.                 <li>
  215.  
  216.                     <a href="#">
  217.  
  218.                         <img src="http://www.mastercafe.com/ejemplos/slideboxmenu/images/5.jpg" alt=""/>
  219.  
  220.                         <span class="sdt_active"></span>
  221.  
  222.                         <span class="sdt_wrap">
  223.  
  224.                             <span class="sdt_link">Blog</span>
  225.  
  226.                             <span class="sdt_descr">I write about design</span>
  227.  
  228.                         </span>
  229.  
  230.                     </a>
  231.  
  232.                 </li>
  233.  
  234.                 <li>
  235.  
  236.                     <a href="#">
  237.  
  238.                         <img src="http://www.mastercafe.com/ejemplos/slideboxmenu/images/6.jpg" alt=""/>
  239.  
  240.                         <span class="sdt_active"></span>
  241.  
  242.                         <span class="sdt_wrap">
  243.  
  244.                             <span class="sdt_link">Projects</span>
  245.  
  246.                             <span class="sdt_descr">I like to code</span>
  247.  
  248.                         </span>
  249.  
  250.                     </a>
  251.  
  252.                     <div class="sdt_box">
  253.  
  254.                         <a href="#">Job Board Website</a>
  255.  
  256.                         <a href="#">Shopping Cart</a>
  257.  
  258.                         <a href="#">Interactive Maps</a>
  259.  
  260.                     </div>
  261.  
  262.                 </li>
  263.  
  264.             </ul>
  265.  
  266.         </div>
  267.  
  268.  
  269.  
  270.  
  271. <script src="http://www.mastercafe.com/ejemplos/slideboxmenu/jquery.easing.1.3.js" language="javascript"></script>
  272. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  273. <script type="text/javascript">
  274.  
  275.             $(function() {
  276.  
  277.                 /**
  278.  
  279.                 * for each menu element, on mouseenter,
  280.  
  281.                 * we enlarge the image, and show both sdt_active span and
  282.  
  283.                 * sdt_wrap span. If the element has a sub menu (sdt_box),
  284.  
  285.                 * then we slide it - if the element is the last one in the menu
  286.  
  287.                 * we slide it to the left, otherwise to the right
  288.  
  289.                 */
  290.  
  291.                 $('#sdt_menu > li').bind('mouseenter',function(){
  292.  
  293.                     var $elem = $(this);
  294.  
  295.                     $elem.find('img')
  296.  
  297.                          .stop(true)
  298.  
  299.                          .animate({
  300.  
  301.                             'width':'170px',
  302.  
  303.                             'height':'170px',
  304.  
  305.                             'left':'0px'
  306.  
  307.                          },400,'easeOutBack')
  308.  
  309.                          .andSelf()
  310.  
  311.                          .find('.sdt_wrap')
  312.  
  313.                          .stop(true)
  314.  
  315.                          .animate({'top':'140px'},500,'easeOutBack')
  316.  
  317.                          .andSelf()
  318.  
  319.                          .find('.sdt_active')
  320.  
  321.                          .stop(true)
  322.  
  323.                          .animate({'height':'170px'},300,function(){
  324.  
  325.                         var $sub_menu = $elem.find('.sdt_box');
  326.  
  327.                         if($sub_menu.length){
  328.  
  329.                             var left = '170px';
  330.  
  331.                             if($elem.parent().children().length == $elem.index()+1)
  332.  
  333.                                 left = '-170px';
  334.  
  335.                             $sub_menu.show().animate({'left':left},200);
  336.  
  337.                         }  
  338.  
  339.                     });
  340.  
  341.                 }).bind('mouseleave',function(){
  342.  
  343.                     var $elem = $(this);
  344.  
  345.                     var $sub_menu = $elem.find('.sdt_box');
  346.  
  347.                     if($sub_menu.length)
  348.  
  349.                         $sub_menu.hide().css('left','0px');
  350.  
  351.                    
  352.  
  353.                     $elem.find('.sdt_active')
  354.  
  355.                          .stop(true)
  356.  
  357.                          .animate({'height':'0px'},300)
  358.  
  359.                          .andSelf().find('img')
  360.  
  361.                          .stop(true)
  362.  
  363.                          .animate({
  364.  
  365.                             'width':'0px',
  366.  
  367.                             'height':'0px',
  368.  
  369.                             'left':'85px'},400)
  370.  
  371.                          .andSelf()
  372.  
  373.                          .find('.sdt_wrap')
  374.  
  375.                          .stop(true)
  376.  
  377.                          .animate({'top':'25px'},500);
  378.  
  379.                 });
  380.  
  381.             });
  382.  
  383.         </script>
  384.  
  385.  
  386.  
  387. </body>
  388. </html>
__________________
Si Crees que puedes o no, en ambos casos tienes Razón. (H. Ford).


http://img710.imageshack.us/img710/1...developers.gif