Foros del Web » Programando para Internet » Jquery »

boton prev

Estas en el tema de boton prev en el foro de Jquery en Foros del Web. Tengo una galeria y todo funciona muy bien menos el boton de prev alguien me puede ayudar? este es el codigo de la galeria: $(window).load(function(){ ...
  #1 (permalink)  
Antiguo 13/06/2013, 16:44
 
Fecha de Ingreso: septiembre-2003
Ubicación: Bogota
Mensajes: 266
Antigüedad: 20 años, 7 meses
Puntos: 0
boton prev

Tengo una galeria y todo funciona muy bien menos el boton de prev alguien me puede ayudar?
este es el codigo de la galeria:
$(window).load(function(){

// ieCheck
var ie = false;
var aniButtonDuration = 350;

if($.browser.msie && $.browser.version<9)
{
aniButtonDuration = 0;
ie = true;
}


//resize
var mainDIV = $('.main');
var nextPic = $('#next_pic')
var prevPic = $('#prev_pic')

var minW = $('body').css("min-width");
var minH = $('body').css("min-height");

//esto va a controlar el fondo :S :S
mainDIV_H = 1;

var window_W = $(document).width();
var window_H = $(document).height();

$(window).resize(function()
{
resizeContent();
});


function resizeContent()
{
window_W = $(document).width();
window_H = $(document).height();

nextPic.css({top:(window_H-nextPic.height())/2});
prevPic.css({top:(window_H-prevPic.height())/2});
}

$('#bgStretch')
.bgStretch({
navigs:$('#gallery').navigs({nextBtn:$('#next_pic' )})
}).sImg({
spinner:$('.gall_spinner').hide()
})
.bgStretch({
navigs:$('#gallery').navigs({prevBtn:$('#prev_pic' )})
}).sImg({
spinner:$('.gall_spinner').hide()
})


$('#gallery li').hover(function()
{
if(!$(this).hasClass('active')){
$(this).find('span').stop().animate({opacity:0}, aniButtonDuration,'easeOutCubic')
}
}, function(){
if(!$(this).hasClass('active')){
$(this).find('span').stop().animate({opacity:1}, aniButtonDuration,'easeOutCubic')
}
})


slideThumbs();
$("#gallery > div").FlowSlider();


$('#icon1, #icon2, #icon3, #icon4, #icon5, #next_pic, #prev_pic')
.sprites({
method:'simple',
duration:400,
easing:'easeOutQuint',
hover:true
})

$('.scroll, .scroll2').cScroll({
duration:700,
step:100,
trackCl:'track',
shuttleCl:'shuttle',
})


$('.list2 li span').css({opacity:0})
$('.list2 li a').hover(function()
{
$(this).find('span').stop().animate({opacity:1}, aniButtonDuration,'easeOutCubic')
}, function(){
$(this).find('span').stop().animate({opacity:0}, aniButtonDuration,'easeOutCubic')
})

resizeContent();

///////////////////////////////////////////////////////////////////////////
// content switch //
///////////////////////////////////////////////////////////////////////////

var content=$('#content'),
nav=$('.menu');


var gallery = $('#gallery');
var navigation = $('#gallery > a');
var imgList = $('#gallery ul');
var imgListH = 125;
var timeoutId;


imgList.css({top: imgListH});

gallery.hover(function()
{
clearTimeout(timeoutId);
showMenu();
}, function(){
timeoutId = setTimeout(hideMenu, 150);
})

function showMenu(){
gallery.css({height:imgListH});
imgList.stop().animate({top:'0px'}, 600, 'easeOutCubic');
navigation.stop().animate({bottom:'-32px'}, 150, 'easeInSine');
}
function hideMenu(){
navigation.stop().animate({bottom:'0px'}, 550, 'easeOutCubic');
imgList.stop().animate({top:imgListH}, 500, 'easeInSine', function(){
gallery.css({height:'32px'});
});
}



$('#menu').superfish({
delay: 700,
animation: {height:'show'},
speed: 350,
autoArrows: false,
dropShadows: false
});


nav.navs({
useHash:true,
defHash:'#!/page_portfolio',
hoverIn:function(li){
$('>a',li).stop().animate({color:'#fff'}, 250,'easeOutSine');
},
hoverOut:function(li){
if (!li.hasClass('with_ul') || !li.hasClass('sfHover')) {
$('>a',li).stop().animate({color:'#888787'}, 250,'easeOutSine');
}
}
})

content.tabs({
preFu:function(_)
{
_.li.css({display:'none', top:'511px'});
}
,actFu:function(_)
{

if(_.pren == 0){
aniDelay = 0;
} else {
aniDelay = 400;
}


if(_.n == 0){

gallery.css({display:'block'}).stop().animate({opa city:1}, aniButtonDuration);
nextPic.css({display:'block'}).stop().animate({opa city:1}, aniButtonDuration);
prevPic.css({display:'block'}).stop().animate({opa city:1}, aniButtonDuration);

if(_.prev){
_.prev
.stop()
.animate({top:'511px'}, 350,'easeInSine', function(){
$(this).css({display:'none'});
});
}

} else {

gallery.stop().animate({opacity:0}, aniButtonDuration, function(){
gallery.css({display:'none'});
});
nextPic.stop().animate({opacity:0}, aniButtonDuration, function(){
nextPic.css({display:'none'});
});
prevPic.stop().animate({opacity:0}, aniButtonDuration, function(){
prevPic.css({display:'none'});
});

if(_.curr){
_.curr
.stop()
.delay(aniDelay).css({display:'block'}).animate({t op:'0px'}, 750,'easeOutQuint');
}

if(_.prev){
_.prev
.stop()
.animate({top:'511px'}, 350,'easeInSine', function(){
$(this).css({display:'none'});
});
}
}

}

})

nav.navs(function(n, _)
{
content.tabs(n);
})



function slideThumbs(){

transition = 'easeOutCubic';
duration = 550;

galleryUl = $('#gallery ul');
galleryLi = $('#gallery li');
maxW = 190;
minW = 125;
imgMargin = -(maxW-minW)/2
galleryUl_W = (galleryLi.length-1) * minW;

galleryUl.width(galleryUl_W + maxW);
galleryLi.width(minW);
galleryLi.find('img').css({marginLeft:imgMargin});

galleryLi.hover(function()
{
over($(this).index());
}, function(){
out();
})

function over(itemNum){
galleryLi.eq(itemNum).stop().animate({width:maxW}, duration, transition);
galleryLi.eq(itemNum).find('img').stop().animate({ marginLeft:'0px'}, duration, transition);
}
function out(){
galleryLi.stop().animate({width:minW}, duration, transition);
galleryLi.find('img').stop().animate({marginLeft:i mgMargin}, duration, transition);
}

}

})

gracias
__________________
anaky
  #2 (permalink)  
Antiguo 13/06/2013, 17:38
 
Fecha de Ingreso: septiembre-2003
Ubicación: Bogota
Mensajes: 266
Antigüedad: 20 años, 7 meses
Puntos: 0
Respuesta: boton prev

este es el codigo original sin modificarlo
$(window).load(function(){

// ieCheck
var ie = false;
var aniButtonDuration = 350;

if($.browser.msie && $.browser.version<9)
{
aniButtonDuration = 0;
ie = true;
}


//resize
var mainDIV = $('.main');
var nextPic = $('#next_pic');

var minW = $('body').css("min-width");
var minH = $('body').css("min-height");


mainDIV_H = 628;

var window_W = $(document).width();
var window_H = $(document).height();

$(window).resize(function()
{
resizeContent();
});


function resizeContent()
{
window_W = $(document).width();
window_H = $(document).height();

nextPic.css({top:(window_H-nextPic.height())/2});
}

$('#bgStretch')
.bgStretch({
navigs:$('#gallery').navigs({nextBtn:$('#next_pic' )})
}).sImg({
spinner:$('.gall_spinner').hide()
})



$('#gallery li').hover(function()
{
if(!$(this).hasClass('active')){
$(this).find('span').stop().animate({opacity:0}, aniButtonDuration,'easeOutCubic')
}
}, function(){
if(!$(this).hasClass('active')){
$(this).find('span').stop().animate({opacity:1}, aniButtonDuration,'easeOutCubic')
}
})


slideThumbs();
$("#gallery > div").FlowSlider();


$('#icon1, #icon2, #icon3, #icon4, #next_pic')
.sprites({
method:'simple',
duration:400,
easing:'easeOutQuint',
hover:true
})

$('.scroll, .scroll2').cScroll({
duration:700,
step:100,
trackCl:'track',
shuttleCl:'shuttle',
})


$('.list2 li span').css({opacity:0})
$('.list2 li a').hover(function()
{
$(this).find('span').stop().animate({opacity:1}, aniButtonDuration,'easeOutCubic')
}, function(){
$(this).find('span').stop().animate({opacity:0}, aniButtonDuration,'easeOutCubic')
})

resizeContent();

///////////////////////////////////////////////////////////////////////////
// content switch //
///////////////////////////////////////////////////////////////////////////

var content=$('#content'),
nav=$('.menu');


var gallery = $('#gallery');
var navigation = $('#gallery > a');
var imgList = $('#gallery ul');
var imgListH = 458;
var timeoutId;


imgList.css({top: imgListH});

gallery.hover(function()
{
clearTimeout(timeoutId);
showMenu();
}, function(){
timeoutId = setTimeout(hideMenu, 150);
})

function showMenu(){
gallery.css({height:imgListH});
imgList.stop().animate({top:'0px'}, 600, 'easeOutCubic');
navigation.stop().animate({bottom:'-32px'}, 150, 'easeInSine');
}
function hideMenu(){
navigation.stop().animate({bottom:'0px'}, 550, 'easeOutCubic');
imgList.stop().animate({top:imgListH}, 500, 'easeInSine', function(){
gallery.css({height:'32px'});
});
}



$('#menu').superfish({
delay: 700,
animation: {height:'show'},
speed: 350,
autoArrows: false,
dropShadows: false
});


nav.navs({
useHash:true,
defHash:'#!/page_portfolio',
hoverIn:function(li){
$('>a',li).stop().animate({color:'#fff'}, 250,'easeOutSine');
},
hoverOut:function(li){
if (!li.hasClass('with_ul') || !li.hasClass('sfHover')) {
$('>a',li).stop().animate({color:'#888787'}, 250,'easeOutSine');
}
}
})

content.tabs({
preFu:function(_)
{
_.li.css({display:'none', top:'511px'});
}
,actFu:function(_)
{

if(_.pren == 0){
aniDelay = 0;
} else {
aniDelay = 400;
}


if(_.n == 0){

gallery.css({display:'block'}).stop().animate({opa city:1}, aniButtonDuration);
nextPic.css({display:'block'}).stop().animate({opa city:1}, aniButtonDuration);

if(_.prev){
_.prev
.stop()
.animate({top:'511px'}, 350,'easeInSine', function(){
$(this).css({display:'none'});
});
}

} else {

gallery.stop().animate({opacity:0}, aniButtonDuration, function(){
gallery.css({display:'none'});
});
nextPic.stop().animate({opacity:0}, aniButtonDuration, function(){
nextPic.css({display:'none'});
});


if(_.curr){
_.curr
.stop()
.delay(aniDelay).css({display:'block'}).animate({t op:'0px'}, 750,'easeOutQuint');
}

if(_.prev){
_.prev
.stop()
.animate({top:'511px'}, 350,'easeInSine', function(){
$(this).css({display:'none'});
});
}
}

}

})

nav.navs(function(n, _)
{
content.tabs(n);
})



function slideThumbs(){

transition = 'easeOutCubic';
duration = 550;

galleryUl = $('#gallery ul');
galleryLi = $('#gallery li');
maxW = 650;
minW = 250;
imgMargin = -(maxW-minW)/2
galleryUl_W = (galleryLi.length-1) * minW;

galleryUl.width(galleryUl_W + maxW);
galleryLi.width(minW);
galleryLi.find('img').css({marginLeft:imgMargin});

galleryLi.hover(function()
{
over($(this).index());
}, function(){
out();
})

function over(itemNum){
galleryLi.eq(itemNum).stop().animate({width:maxW}, duration, transition);
galleryLi.eq(itemNum).find('img').stop().animate({ marginLeft:'0px'}, duration, transition);
}
function out(){
galleryLi.stop().animate({width:minW}, duration, transition);
galleryLi.find('img').stop().animate({marginLeft:i mgMargin}, duration, transition);
}

}

})
__________________
anaky

Etiquetas: boton
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 12:32.