Fichas de desplazamiento de jQuery
- ScottG
- Proficient


- Registrado: Jul 06, 2010
- Mensajes: 266
- Status: Online
Antes de buceo en la codificación me preguntaba lo que nadie ha sido a través de un Jquery desplazamiento ejemplo de fichas como los 4 Ex Js avanzado fichashttp://try.sencha.com/extjs/4.0.7/examp ... /tabs-adv/
He encontrado algunos ejemplos de Jquery base pero el cochecito parece al menos en 18 de Firefox. http://www.seyfertdesign.com/jquery/demo.htmlpero también tienen el desplazamiento que Im looking for. Así que si alguien ha visto algo me deja saber. Probablemente voy a empezar hacer mi propio en un par de días. Cuando hago posteare el script aquí.
He encontrado algunos ejemplos de Jquery base pero el cochecito parece al menos en 18 de Firefox. http://www.seyfertdesign.com/jquery/demo.htmlpero también tienen el desplazamiento que Im looking for. Así que si alguien ha visto algo me deja saber. Probablemente voy a empezar hacer mi propio en un par de días. Cuando hago posteare el script aquí.
- Anonymous
- Bot


- Registrado: 25 Feb 2008
- Mensajes: ?
- Loc: Ozzuland
- Status: Online
Enero 15th, 2013, 11:06 am
- Zealous
- Guru


- Registrado: Abr 15, 2011
- Mensajes: 1195
- Loc: Sydney
- Status: Offline
- ScottG
- Proficient


- Registrado: Jul 06, 2010
- Mensajes: 266
- Status: Online
Eso es cierto pero la la cuestión es que las fichas utilizan flotador izquierda y cuando el golpe final envuelve las fichas a la línea siguiente. Esta es la funcionalidad básica de la función de pestañas de Jquery ui. ID tiene que resolver ese problema antes que nada.
Así que comencé a trabajar en él hoy y esto es lo que me ocurrió en mi primer paso
Su un poco desordenada y no comentado bien y todavía va a añadir funciones de Im.
Si alguno tiene un script de buena extensión para un widget de interfaz de usuario de jquery amor Id a verla que pasé más tiempo tratando de ampliar la función de crear en las fichas y añadir a las opciones seguí acercando pero siempre habrá algún error extraño que lo sucedió decidí en este
Me gustaría poder hacer esto. (Im cerca de llegar a este punto)
Trabajo bien mal en esta mañana me supongo que fuera del trabajo hace unos 15 minutos. Si alguna idea por favor hágamelo saber.
Así que comencé a trabajar en él hoy y esto es lo que me ocurrió en mi primer paso
Su un poco desordenada y no comentado bien y todavía va a añadir funciones de Im.
Si alguno tiene un script de buena extensión para un widget de interfaz de usuario de jquery amor Id a verla que pasé más tiempo tratando de ampliar la función de crear en las fichas y añadir a las opciones seguí acercando pero siempre habrá algún error extraño que lo sucedió decidí en este
JAVASCRIPT Código: [ Select ]
var tabs = $("#tabs").scrollableTabs();
- var tabs = $("#tabs").scrollableTabs();
Me gustaría poder hacer esto. (Im cerca de llegar a este punto)
JAVASCRIPT Código: [ Select ]
var tabs = $("#tabs").tabs({scrollable:true, scrollSpeed: 40, scollToActive:true});
- var tabs = $("#tabs").tabs({scrollable:true, scrollSpeed: 40, scollToActive:true});
Trabajo bien mal en esta mañana me supongo que fuera del trabajo hace unos 15 minutos. Si alguna idea por favor hágamelo saber.
Attachments:
- ScottG
- Proficient


- Registrado: Jul 06, 2010
- Mensajes: 266
- Status: Online
OK así algún tiempo lejos de codificación me hice buena Ive reescrito el script para trabajar de la forma que quiero. Este es el núcleo del guión que todavía estoy agregando a ella.
Aunque no es mi completa el código de registro por lo que se puede probar por otros para ver si hay problemas de Ive perdido hasta ahora
// Basic jQuery UI tabs
var tabs = $("#tabs").tabs();
// Basic jQuery UI tabs with scrollable capability
var tabs = $("#tabs").tabs({scrollable:true});
// Added features
var tabs = $("#tabs").tabs({scrollable:true, scrollSpeed: 100, easing: 'easeOutBounce', duration: 500});
// Features to be added
var tabs = $("#tabs").tabs({scrollToActive});
Sé que la velocidad de desplazamiento y la duración pueden parecer como uno en el mismo. Tal vez pude han utilizado un término diferente.
scrollSpeed - es la cantidad de las fichas se mueven en un solo haga clic en o si el botón se mantiene pulsado la cantidad las fichas mover cada vez que se llama a la función para moverlos
duración - es la cantidad de tiempo para la animación se llevará a cabo.
Si hay un término mejor déjeme por favor saber también quisiera saber si alguien ha encontrado problemas.
Aunque no es mi completa el código de registro por lo que se puede probar por otros para ver si hay problemas de Ive perdido hasta ahora
JAVASCRIPT Código: [ Select ]
// Basic jQuery UI tabs
var tabs = $("#tabs").tabs();
// Basic jQuery UI tabs with scrollable capability
var tabs = $("#tabs").tabs({scrollable:true});
// Added features
var tabs = $("#tabs").tabs({scrollable:true, scrollSpeed: 100, easing: 'easeOutBounce', duration: 500});
// Features to be added
var tabs = $("#tabs").tabs({scrollToActive});
- // Basic jQuery UI tabs
- var tabs = $("#tabs").tabs();
- // Basic jQuery UI tabs with scrollable capability
- var tabs = $("#tabs").tabs({scrollable:true});
- // Added features
- var tabs = $("#tabs").tabs({scrollable:true, scrollSpeed: 100, easing: 'easeOutBounce', duration: 500});
- // Features to be added
- var tabs = $("#tabs").tabs({scrollToActive});
Sé que la velocidad de desplazamiento y la duración pueden parecer como uno en el mismo. Tal vez pude han utilizado un término diferente.
scrollSpeed - es la cantidad de las fichas se mueven en un solo haga clic en o si el botón se mantiene pulsado la cantidad las fichas mover cada vez que se llama a la función para moverlos
duración - es la cantidad de tiempo para la animación se llevará a cabo.
Si hay un término mejor déjeme por favor saber también quisiera saber si alguien ha encontrado problemas.
Attachments:
- ScottG
- Proficient


- Registrado: Jul 06, 2010
- Mensajes: 266
- Status: Online
OK aunque Im no en el trabajo no puedo dejar de trabajar en esto. Su demasiado divertido
por lo que he encontrado algunas cosas que causó algunos problemas y les fija. También parece podría han subido el archivo zip mal tiempo pasado...Oh bien ha sido actualizado desde entonces.
OK, así que es donde estoy. Todas las características que quiero en este momento en se encuentran en el script actualizado ha sido comentado mejor y mucho se ha agregado.
uso
Hay cierta extrañeza que ocurre cuando se tire de la lengüeta de la barra y colocarlo. Activa y vaya que del extremo izquierdo. Mal trabajo en más tarde
OK, así que es donde estoy. Todas las características que quiero en este momento en se encuentran en el script actualizado ha sido comentado mejor y mucho se ha agregado.
uso
JAVASCRIPT Código: [ Select ]
// Basic jQuery UI tabs
var tabs = $("#tabs").tabs();
// Basic jQuery UI tabs with scrollable capability
var tabs = $("#tabs").tabs({scrollable:true});
// Added features
var tabs = $("#tabs").tabs({scrollable:true, scrollSpeed: 100, easing: 'easeOutBounce', duration: 500, scrollToActive:true, leftButton: '<button id="left_button" href="#"><span></span></button>', rightButton: '<button id="right_button" href="#"><span></span></button>'});
var tabs = $("#tabs").tabs();
// Basic jQuery UI tabs with scrollable capability
var tabs = $("#tabs").tabs({scrollable:true});
// Added features
var tabs = $("#tabs").tabs({scrollable:true, scrollSpeed: 100, easing: 'easeOutBounce', duration: 500, scrollToActive:true, leftButton: '<button id="left_button" href="#"><span></span></button>', rightButton: '<button id="right_button" href="#"><span></span></button>'});
- // Basic jQuery UI tabs
- var tabs = $("#tabs").tabs();
- // Basic jQuery UI tabs with scrollable capability
- var tabs = $("#tabs").tabs({scrollable:true});
- // Added features
- var tabs = $("#tabs").tabs({scrollable:true, scrollSpeed: 100, easing: 'easeOutBounce', duration: 500, scrollToActive:true, leftButton: '<button id="left_button" href="#"><span></span></button>', rightButton: '<button id="right_button" href="#"><span></span></button>'});
Hay cierta extrañeza que ocurre cuando se tire de la lengüeta de la barra y colocarlo. Activa y vaya que del extremo izquierdo. Mal trabajo en más tarde
Attachments:
- ScottG
- Proficient


- Registrado: Jul 06, 2010
- Mensajes: 266
- Status: Online
Así que para cualquiera que aún siguiendo junto con esto soluciono el extraño comportamiento que fue causado por tirar de la pestaña fuera de la barra.
Cuando configura tipo capacidad en esta secuencia de comandos debe definir tabs.tabs ("opción", "ordenación", true); en la función de parada. Esto le indicará la secuencia de comandos que estamos clasificando y seleccionando no sólo una ficha. Lo hice así para que no necesitaba combinar el widget puede ordenar en el widget de fichas.
Ive también hizo una nueva función con el único propósito de activar o desactivar los botones de flecha con esta función llegó la función que si teníamos suficientes fichas para desplazarse y retirar las fichas las flechas desactivará si añadimos luego lengüetas o redimensionar la ventana en donde tenemos suficientes fichas para desplazarse permitirá.
También con esto descubrí que mi extensión a la scollPare no función estaba causando demasiados errores de recursividad y me fijo así.
Una cosa que Im no satisfecho en algunas de las ecuaciones que utilizo parecen Hacky tiene que ser una fórmula mejor para esto son las dos ecuaciones en cuestión.
Si alguien puede ayudar a obtener estos no parecen estar tan hackeado que sería genial. Ver el debajo de funciones para el uso
Cuando configura tipo capacidad en esta secuencia de comandos debe definir tabs.tabs ("opción", "ordenación", true); en la función de parada. Esto le indicará la secuencia de comandos que estamos clasificando y seleccionando no sólo una ficha. Lo hice así para que no necesitaba combinar el widget puede ordenar en el widget de fichas.
JAVASCRIPT Código: [ Select ]
tabs.find(".ui-tabs-nav").sortable({
//axis: "x",
stop: function() {
tabs.tabs("refresh");
tabs.tabs("option", "sorting", true);
},
containment: $("#bar_container")
});
//axis: "x",
stop: function() {
tabs.tabs("refresh");
tabs.tabs("option", "sorting", true);
},
containment: $("#bar_container")
});
- tabs.find(".ui-tabs-nav").sortable({
- //axis: "x",
- stop: function() {
- tabs.tabs("refresh");
- tabs.tabs("option", "sorting", true);
- },
- containment: $("#bar_container")
- });
Ive también hizo una nueva función con el único propósito de activar o desactivar los botones de flecha con esta función llegó la función que si teníamos suficientes fichas para desplazarse y retirar las fichas las flechas desactivará si añadimos luego lengüetas o redimensionar la ventana en donde tenemos suficientes fichas para desplazarse permitirá.
También con esto descubrí que mi extensión a la scollPare no función estaba causando demasiados errores de recursividad y me fijo así.
Una cosa que Im no satisfecho en algunas de las ecuaciones que utilizo parecen Hacky tiene que ser una fórmula mejor para esto son las dos ecuaciones en cuestión.
JAVASCRIPT Código: [ Select ]
(element.width() - 1 + element.scrollLeft()) < element[0].scrollWidth
(settings.bar_width < $('#tabs_container').width() - 5) ? $('#tabs_container').width() - 5
(settings.bar_width < $('#tabs_container').width() - 5) ? $('#tabs_container').width() - 5
- (element.width() - 1 + element.scrollLeft()) < element[0].scrollWidth
- (settings.bar_width < $('#tabs_container').width() - 5) ? $('#tabs_container').width() - 5
Si alguien puede ayudar a obtener estos no parecen estar tan hackeado que sería genial. Ver el debajo de funciones para el uso
JAVASCRIPT Código: [ Select ]
// This function will be used to scroll the the tabs.
move_bar: function(element, left, that) {
// Check to see if we are going to scroll left
if(left) {
// Check to see if the scroll left is greater than 0
if(element.scrollLeft() > 0) {
// Start the scrolling
element.animate({ scrollLeft : "-=" + that.options.scrollSpeed }, {queue: true, easing: that.options.easing, duration: that.options.duration, complete: function(){
// Check to see if we are currenly scrolling
if(settings.scrolling) {
// We are still scrolling so call the function again
that.move_bar(element, left, that);
}
// Disable the buttons
that._disable_buttons(element);
}});
} else {
// Disable the buttons
that._disable_buttons(element);
}
} else {
// Check to see if the Scroll if at the max
if((element.width() - 1 + element.scrollLeft()) < element[0].scrollWidth) {
// Start the scrolling
element.animate({ scrollLeft : "+=" + that.options.scrollSpeed }, {queue: true, easing: that.options.easing, duration: that.options.duration, complete: function(){
// Check to see if we are currenly scrolling
if(settings.scrolling) {
// We are still scrolling so call the function again
that.move_bar(element, left, that);
}
// Disable the buttons
that._disable_buttons(element);
}});
} else {
// Disable the buttons
that._disable_buttons(element);
}
}
},
// This function will diable the arrows buttons if needed
_disable_buttons: function(element) {
// Remove the disabled states
$("#left_button").removeAttr("disabled").removeClass("ui-state-disabled");
$("#right_button").removeAttr("disabled").removeClass("ui-state-disabled");
// Check to see if we are at the begining of the scrolling element
if(element.scrollLeft() == 0) {
// Set to the max scroll
element.scrollLeft(0);
// Disable the left button
$("#left_button").attr("disabled", "disabled").addClass("ui-state-disabled");
}
// Check to see if we are at the end of the scrolling element
if((element.width() - 1 + element.scrollLeft()) >= element[0].scrollWidth) {
// Set to the max scroll
element.scrollLeft(element[0].scrollWidth);
// Disable the right button
$("#right_button").attr("disabled", "disabled").addClass("ui-state-disabled");
}
// Check to see if there is even an ability to scroll
if(element.width() == element[0].scrollWidth) {
// Disable the left and right button
$("#left_button").attr("disabled", "disabled").addClass("ui-state-disabled");
$("#right_button").attr("disabled", "disabled").addClass("ui-state-disabled");
}
},
// This function will set the ULs width
_get_bar_width: function() {
// Rest the bar width
settings.bar_width = 0;
// Loop through the UL LI tags
this.element.find(".ui-tabs-nav:first li").each(function() {
// Add the outWidth of the LI to the bar_width varible
settings.bar_width += $(this).outerWidth(true);
});
// This line fixes any wrapping issue that are caused by the first two tabs
settings.bar_width = (settings.bar_width < $('#tabs_container').width() - 5) ? $('#tabs_container').width() - 5 : settings.bar_width;
// Return the width
return settings.bar_width;
}
move_bar: function(element, left, that) {
// Check to see if we are going to scroll left
if(left) {
// Check to see if the scroll left is greater than 0
if(element.scrollLeft() > 0) {
// Start the scrolling
element.animate({ scrollLeft : "-=" + that.options.scrollSpeed }, {queue: true, easing: that.options.easing, duration: that.options.duration, complete: function(){
// Check to see if we are currenly scrolling
if(settings.scrolling) {
// We are still scrolling so call the function again
that.move_bar(element, left, that);
}
// Disable the buttons
that._disable_buttons(element);
}});
} else {
// Disable the buttons
that._disable_buttons(element);
}
} else {
// Check to see if the Scroll if at the max
if((element.width() - 1 + element.scrollLeft()) < element[0].scrollWidth) {
// Start the scrolling
element.animate({ scrollLeft : "+=" + that.options.scrollSpeed }, {queue: true, easing: that.options.easing, duration: that.options.duration, complete: function(){
// Check to see if we are currenly scrolling
if(settings.scrolling) {
// We are still scrolling so call the function again
that.move_bar(element, left, that);
}
// Disable the buttons
that._disable_buttons(element);
}});
} else {
// Disable the buttons
that._disable_buttons(element);
}
}
},
// This function will diable the arrows buttons if needed
_disable_buttons: function(element) {
// Remove the disabled states
$("#left_button").removeAttr("disabled").removeClass("ui-state-disabled");
$("#right_button").removeAttr("disabled").removeClass("ui-state-disabled");
// Check to see if we are at the begining of the scrolling element
if(element.scrollLeft() == 0) {
// Set to the max scroll
element.scrollLeft(0);
// Disable the left button
$("#left_button").attr("disabled", "disabled").addClass("ui-state-disabled");
}
// Check to see if we are at the end of the scrolling element
if((element.width() - 1 + element.scrollLeft()) >= element[0].scrollWidth) {
// Set to the max scroll
element.scrollLeft(element[0].scrollWidth);
// Disable the right button
$("#right_button").attr("disabled", "disabled").addClass("ui-state-disabled");
}
// Check to see if there is even an ability to scroll
if(element.width() == element[0].scrollWidth) {
// Disable the left and right button
$("#left_button").attr("disabled", "disabled").addClass("ui-state-disabled");
$("#right_button").attr("disabled", "disabled").addClass("ui-state-disabled");
}
},
// This function will set the ULs width
_get_bar_width: function() {
// Rest the bar width
settings.bar_width = 0;
// Loop through the UL LI tags
this.element.find(".ui-tabs-nav:first li").each(function() {
// Add the outWidth of the LI to the bar_width varible
settings.bar_width += $(this).outerWidth(true);
});
// This line fixes any wrapping issue that are caused by the first two tabs
settings.bar_width = (settings.bar_width < $('#tabs_container').width() - 5) ? $('#tabs_container').width() - 5 : settings.bar_width;
// Return the width
return settings.bar_width;
}
- // This function will be used to scroll the the tabs.
- move_bar: function(element, left, that) {
- // Check to see if we are going to scroll left
- if(left) {
- // Check to see if the scroll left is greater than 0
- if(element.scrollLeft() > 0) {
- // Start the scrolling
- element.animate({ scrollLeft : "-=" + that.options.scrollSpeed }, {queue: true, easing: that.options.easing, duration: that.options.duration, complete: function(){
- // Check to see if we are currenly scrolling
- if(settings.scrolling) {
- // We are still scrolling so call the function again
- that.move_bar(element, left, that);
- }
- // Disable the buttons
- that._disable_buttons(element);
- }});
- } else {
- // Disable the buttons
- that._disable_buttons(element);
- }
- } else {
- // Check to see if the Scroll if at the max
- if((element.width() - 1 + element.scrollLeft()) < element[0].scrollWidth) {
- // Start the scrolling
- element.animate({ scrollLeft : "+=" + that.options.scrollSpeed }, {queue: true, easing: that.options.easing, duration: that.options.duration, complete: function(){
- // Check to see if we are currenly scrolling
- if(settings.scrolling) {
- // We are still scrolling so call the function again
- that.move_bar(element, left, that);
- }
- // Disable the buttons
- that._disable_buttons(element);
- }});
- } else {
- // Disable the buttons
- that._disable_buttons(element);
- }
- }
- },
- // This function will diable the arrows buttons if needed
- _disable_buttons: function(element) {
- // Remove the disabled states
- $("#left_button").removeAttr("disabled").removeClass("ui-state-disabled");
- $("#right_button").removeAttr("disabled").removeClass("ui-state-disabled");
- // Check to see if we are at the begining of the scrolling element
- if(element.scrollLeft() == 0) {
- // Set to the max scroll
- element.scrollLeft(0);
- // Disable the left button
- $("#left_button").attr("disabled", "disabled").addClass("ui-state-disabled");
- }
- // Check to see if we are at the end of the scrolling element
- if((element.width() - 1 + element.scrollLeft()) >= element[0].scrollWidth) {
- // Set to the max scroll
- element.scrollLeft(element[0].scrollWidth);
- // Disable the right button
- $("#right_button").attr("disabled", "disabled").addClass("ui-state-disabled");
- }
- // Check to see if there is even an ability to scroll
- if(element.width() == element[0].scrollWidth) {
- // Disable the left and right button
- $("#left_button").attr("disabled", "disabled").addClass("ui-state-disabled");
- $("#right_button").attr("disabled", "disabled").addClass("ui-state-disabled");
- }
- },
- // This function will set the ULs width
- _get_bar_width: function() {
- // Rest the bar width
- settings.bar_width = 0;
- // Loop through the UL LI tags
- this.element.find(".ui-tabs-nav:first li").each(function() {
- // Add the outWidth of the LI to the bar_width varible
- settings.bar_width += $(this).outerWidth(true);
- });
- // This line fixes any wrapping issue that are caused by the first two tabs
- settings.bar_width = (settings.bar_width < $('#tabs_container').width() - 5) ? $('#tabs_container').width() - 5 : settings.bar_width;
- // Return the width
- return settings.bar_width;
- }
Attachments:
Página 1 de 1
Para responder a este tema que necesita para ingresar o registrarse. Es gratis.
Publicar Información
- Total de mensajes en este tema: 6 mensajes
- Usuarios navegando por este Foro: ScottG y 226 invitados
- No puede abrir nuevos temas en este Foro
- No puede responder a temas en este Foro
- No puede editar sus mensajes en este Foro
- No puede borrar sus mensajes en este Foro
- No puede enviar adjuntos en este Foro
