Ver Mensaje Individual
  #7 (permalink)  
Antiguo 04/02/2014, 01:22
Control_z
 
Fecha de Ingreso: noviembre-2011
Mensajes: 15
Antigüedad: 12 años, 5 meses
Puntos: 0
Respuesta: Slider y Lightbox en un mismo documento .html

Esto es lo que he conseguido hasta el momento, se abren las imagenes sin el efecto lightbox y además en la misma ventana. Por otra parte, ambos plugins venian con su propia carpeta de "images" asi que he puesto todas la imagenes en la carpeta "images" de nivo slider, indicandoles la nueva ruta a las imagenes de la galeria.

Código HTML:
Ver original
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  3. <html lang="en">
  4.     <title>Nivo Slider Demo</title>
  5.     <link rel="stylesheet" type="text/css" href="../style-projects-jquery.css" />
  6.    
  7.     <link rel="stylesheet" href="../themes/default/default.css" type="text/css" media="screen" />
  8.     <link rel="stylesheet" href="../themes/light/light.css" type="text/css" media="screen" />
  9.     <link rel="stylesheet" href="../themes/dark/dark.css" type="text/css" media="screen" />
  10.     <link rel="stylesheet" href="../themes/bar/bar.css" type="text/css" media="screen" />
  11.     <link rel="stylesheet" href="../nivo-slider.css" type="text/css" media="screen" />
  12.     <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
  13.    
  14.     <!-- Arquivos utilizados pelo jQuery lightBox plugin -->
  15.     <script type="text/javascript" src="js/jquery.js"></script>
  16.     <script type="text/javascript" src="js/jquery.lightbox-0.5.js"></script>
  17.     <link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" />
  18.     <!-- / fim dos arquivos utilizados pelo jQuery lightBox plugin -->
  19.    
  20.     <!-- Ativando o jQuery lightBox plugin -->
  21.     <script type="text/javascript">
  22.     $(function() {
  23.         $('#gallery a').lightBox();
  24.     });
  25.     </script>
  26.     <style type="text/css">
  27.     /* jQuery lightBox plugin - Gallery style */
  28.     #gallery {
  29.         background-color: #444;
  30.         padding: 10px;
  31.         width: 520px;
  32.     }
  33.     #gallery ul { list-style: none; }
  34.     #gallery ul li { display: inline; }
  35.     #gallery ul img {
  36.         border: 5px solid #3e3e3e;
  37.         border-width: 5px 5px 20px;
  38.     }
  39.     #gallery ul a:hover img {
  40.         border: 5px solid #fff;
  41.         border-width: 5px 5px 20px;
  42.         color: #fff;
  43.     }
  44.     #gallery ul a:hover { color: #fff; }
  45.     </style>
  46. </head>
  47.     <div id="wrapper">
  48.       <div class="slider-wrapper theme-default">
  49.       <div id="slider" class="nivoSlider">
  50.                 <img src="images/toystory.jpg" data-thumb="images/toystory.jpg" alt="" />
  51.                 <a href="http://dev7studios.com"><img src="images/up.jpg" data-thumb="images/up.jpg" alt="" title="This is an example of a caption" /></a>
  52.                 <img src="images/walle.jpg" data-thumb="images/walle.jpg" alt="" data-transition="slideInLeft" />
  53.                 <img src="images/nemo.jpg" data-thumb="images/nemo.jpg" alt="" title="#htmlcaption" />
  54.             </div>
  55.             <div id="htmlcaption" class="nivo-html-caption">
  56.                 <strong>This</strong> is an example of a <em>HTML</em> caption with <a href="#">a link</a>.
  57.             </div>
  58.         </div>
  59.  
  60.     </div>
  61.    
  62.     <div id="gallery">
  63.   <ul>
  64.         <li>
  65.             <a href="images/image1.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery').lightBox();">
  66.                 <img src="images/thumb_image1.jpg" width="72" height="72" alt="" />
  67.             </a>
  68.         </li>
  69.         <li>
  70.             <a href="images/image2.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery a').lightBox();">
  71.                 <img src="images/thumb_image2.jpg" width="72" height="72" alt="" />
  72.             </a>
  73.         </li>
  74.         <li>
  75.             <a href="images/image3.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery a').lightBox();">
  76.                 <img src="images/thumb_image3.jpg" width="72" height="72" alt="" />
  77.             </a>
  78.         </li>
  79.         <li>
  80.             <a href="images/image4.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery a').lightBox();">
  81.                 <img src="images/thumb_image4.jpg" width="72" height="72" alt="" />
  82.             </a>
  83.         </li>
  84.         <li>
  85.             <a href="images/image5.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery a').lightBox();">
  86.                 <img src="images/thumb_image5.jpg" width="72" height="72" alt="" />
  87.             </a>
  88.         </li>
  89.     </ul>
  90. </div>
  91. <script type="text/javascript" src="scripts/jquery-1.9.0.min.js"></script>
  92.     <script type="text/javascript" src="../jquery.nivo.slider.js"></script>
  93.     <script type="text/javascript">
  94.     $(window).load(function() {
  95.         $('#slider').nivoSlider();
  96.     });
  97.     </script>
  98. </body>
  99. </html>