Foros del Web » Programando para Internet » Javascript »

Incluir un JS dentro de otro JS

Estas en el tema de Incluir un JS dentro de otro JS en el foro de Javascript en Foros del Web. Buenas necesito incluir el contenido completo de un archivo que tengo que se llama: tjpzoom.js dentro de este otro documento : jquery.colorbox.js Ya que necesito ...
  #1 (permalink)  
Antiguo 05/05/2011, 07:05
 
Fecha de Ingreso: febrero-2007
Ubicación: Caracas
Mensajes: 148
Antigüedad: 17 años, 2 meses
Puntos: 6
Incluir un JS dentro de otro JS

Buenas necesito incluir el contenido completo de un archivo que tengo que se llama: tjpzoom.js dentro de este otro documento : jquery.colorbox.js

Ya que necesito que la funcion que me muestra la imagen superpocisionada, al hacer clic en la imagen normal, se requiere que la funcion Zoom, este dentro del recuadro que emarca la imagen

Aqui te muestro lo que hace el documento como tal:

http://www.cross-home.com/proyectocr...&id=0020000070 En este link si se pasa el mouse por la imagen grande tiene el efecto lupa, pero no lo necesito alli sino algo asi como en la miniatura que al hacer clic mira lo que pasa, se agranda, alli justamente en ese recuadro necesito el efecto lupa.


el codigo del efecto Galeria enmarcada imagen es asi:

Código:
$("a[rel='galeria']").colorbox.settings = {
	transition : "elastic", // "elastic" or "fade". Set transitionSpeed to 0 for no transition.
	transitionSpeed : 350, // Sets the speed of the fade and elastic transition, in milliseconds. Set to 0 for no transition.
	initialWidth : 300, // Set the initial width of the modal, prior to any content being loaded.
	initialHeight : 100, // Set the initial height of the modal, prior to any content being loaded.
	contentWidth : false, // Set a fixed width for div#modalLoadedContent.  Example: "500px"
	contentHeight : false, // Set a fixed height for div#modalLoadedContent.  Example: "500px"
	contentAjax : false, // Set this to the file, or file+selector of content that will be loaded through an external file.  Example "include.html" or "company.inc.php div#ceo_bio"
	contentInline : false, // Set this to the selector, in jQuery selector format, of inline content to be displayed.  Example "#myHiddenDiv".
	contentIframe : false, // If 'true' specifies that content should be displayed in an iFrame.
	bgOpacity : 0.85, // The modalBackgroundOverlay opacity level. Range: 0 to 1.
	preloading : true, // Allows for preloading of 'Next' and 'Previous' content in a shared relation group (same values for the 'rel' attribute), after the current content has finished loading.  Set to 'false' to disable.
	contentCurrent : "{current} de {total}", // the format of the contentCurrent information
	contentPrevious : "anterior", // the anchor text for the previous link in a shared relation group (same values for 'rel').
	contentNext : "proxima", // the anchor text for the next link in a shared relation group (same 'rel' attribute').
	modalClose : "cerrar", // the anchor text for the close link.  Esc will also close the modal.
	open : false //Automatically opens ColorBox. (fires the click.colorbox event without waiting for user input).
   
}
y el PHP es asi, solo coloque el pedazo donde llamo a galeria,
nota: Este codigo es el que remplace por el efecto lupa este tiene la misma funcion que el de la miniatura.

Código HTML:
echo "<a href='/proyectocrossh/img/productos/1-" . $data_id . ".jpg' title='" . $data_titulo  . "' class='cpModal' rel='galeria'>
<img src='/proyectocrossh/img/productos/1-" . $data_id . ".jpg' alt='" . $data_titulo . "' border='0' width='360' height='361' /></a>";
La pregunta como incluyo la funcion efecto lupa al hacer clic en la imagen grande, y que luego se vea la lupa.
  #2 (permalink)  
Antiguo 05/05/2011, 07:55
Avatar de IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: Incluir un JS dentro de otro JS

en jquery no se si será posible. en js
archivo js.js
Cita:
document.write("<script type='text/javascript' src='js2.js'></script>"); // archivo incluido
function fnc() {
//....
}
se incluiría con
Cita:
<script type="text/javascript" src="js.js"></script>

Etiquetas: js
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 15:38.