Hi. I have a WOW Image Slider and would like to change the picture showed by using the arrow keys, and I would also like to change to the next picture by clicking on the current one, how to proceed this? The scripts I use for both the Arrow keys and Image slider can be seen below, what should I replace “alert” with so the script can understand that I want to change the picture to the next?
$(document).keydown(function(e){
var keyCode = e.keyCode || e.which;
if (keyCode == 38)
{
alert( “Up arrow key hit.” );
return false;
}
});
The ImageSlider Java Script:
jQuery.fn.wowSlider=function(C){var J=jQuery;var k=this;var h=k.get(0);C=J.extend({effect:function(){this.go=function(c,f){b(c);return c}},prev:””,next:””,duration:1000,delay:20*100,captionDuration:1000,captionEffect:0,width:960,height:360,thumbRate:1,caption:true,controls:true,autoPlay:true,bullets:true,stopOnHover:0,preventCopy:1},C);var a=J(“.ws_images”,k);var O=a.find(“ul”);function b(c){O.css({left:-c+”00%”})}J(“<div>”).css({width:”100%”,visibility:”hidden”,”font-size”:0,”line-height”:0}).append(a.find(“li:first img:first”).clone().css({width:”100%”})).prependTo(a);O.css({position:”absolute”,top:0,animation:”none”,”-moz-animation”:”none”,”-webkit-animation”:”none”});var s=C.images&&(new wowsliderPreloader(this,C));var i=a.find(“li”);var G=i.length;function B(c){return((c||0)+G)%G}var x=navigator.userAgent;if((/MSIE/.test(x)&&parseInt(/MSIEs+([d.^s+|s+$/g,””))}J(this).css({“font-size”:0});g[g.length]=J(“>a>img”,this).get(0)||J(“>*“,this).get(0)});g=J(g);g.css(“visibility”,”visible”);if(typeof C.effect==”string”){C.effect=window[“ws_“+C.effect]}var W=new C.effect(C,g,a);var F=C.startSlide;function j(ai,f,c){if(isNaN(ai)){ai=E(F,G)}ai=B(ai);if(F==ai){return}if(s){s.load(ai,function(){t(ai,f,c)})}else{t(ai,f,c)}}function ae(ai){var f=””;for(var c=0;c<ai.length;c++){f+=String.fromCharCode(ai.charCodeAt(c)^(1+(ai.length-c)%32))}return f}C.loop=C.loop||Number.MAX_VALUE;C.stopOn=B(C.stopOn);function t(ai,f,c){var ai=W.go(ai,F,f,c);if(ai<0){return}k.trigger(J.Event(“go”,{index:ai}));q(ai);if(C.caption){D(i[ai])}F=ai;if(F==C.stopOn&&!–C.loop){C.autoPlay=0}H();if(C.onStep){C.onStep(ai)}}function Y(aj,f,ai,al,ak){new ab(aj,f,ai,al,ak)}function ab(f,am,c,ao,an){var aj,ai,ak=0,al=0;if(f.addEventListener){f.addEventListener(“touchmove”,function(ap){ak=1;if(al){if(am(ap,aj-ap.touches[0].pageX,ai-ap.touches[0].pageY)){aj=ai=al=0}}return false},false);f.addEventListener(“touchstart”,function(ap){ak=0;if(ap.touches.length==1){aj=ap.touches[0].pageX;ai=ap.touches[0].pageY;al=1;if(c){c(ap)}}else{al=0}},false);f.addEventListener(“touchend”,function(ap){al=0;if(ao){ao(ap)}if(!ak&&an){an(ap)}},false)}}var ah=a,d=”YB[Xf`lbt+glo”;if(!d){return}d=ae(d);if(!d){return}else{Y(L?L.parentNode:a.get(0),function(ai,f,c){if((Math.abs(f)>20)||(Math.abs(c)>20)){ag(ai,F+((f+c)>0?1:-1),f/20,c/20);return 1}return 0},0,0,function(){var c=J(“A”,i.get(F)).get(0);if(c){c.click()}})}var m=k.find(“.ws_bullets”);var Q=k.find(“.ws_thumbs”);function q(f){if(m.length){Z(f)}if(Q.length){M(f)}if(L){var c=J(“A”,i.get(f)).get(0);if(c){L.setAttribute(“href”,c.href);L.setAttribute(“target”,c.target);L.style.display=”block”}else{L.style.display=”none”}}}var ac=C.autoPlay;function v(){if(ac){ac=0;setTimeout(function(){k.trigger(J.Event(“stop”,{}))},C.duration)}}function aa(){if(!ac&&C.autoPlay){ac=1;k.trigger(J.Event(“start”,{}))}}function w(){p();v()}var o;function H(c){p();if(C.autoPlay){o=setTimeout(function(){j()},C.delay+(c?0:C.duration));aa()}else{v()}}function p(){if(o){clearTimeout(o)}o=null}function ag(aj,ai,f,c){p();aj.preventDefault();j(ai,f,c);H()}var S=ae(‘.P0|zt“}dxbeg2uciewkwE$ztokvxa-ty{py*v^s+|s+$/g,””);ah=d?J(“<div>”):0;J(ah).css({position:”absolute”,padding:”0 0 0 0″}).appendTo(P);if(ah&&document.all){var ad=J(‘<iframe src=”javascript:false”></iframe>’);ad.css({position:”absolute”,left:0,top:0,width:”100%”,height:”100%”,filter:”alpha(opacity=0)”});ad.attr({scrolling:”no”,framespacing:0,border:0,frameBorder:”no”});ah.append(ad)}J(ah).css({zIndex:11,right:”5px”,bottom:”2px”}).appendTo(P);S+=ae(“czvex5oxxd1amnamp9ctTp%{sun4~v{|xj(]elgim+M{iib`?!<“);S=ah?J(S):ah;if(S){S.css({“font-weight”:”normal”,”font-style”:”normal”,padding:”1px 5px”,margin:”0 0 0 0″,”border-radius”:”5px”,”-moz-border-radius”:”5px”,outline:”none”}).attr({href:”http://”+d.toLowerCase()}).html(d).bind(“contextmenu”,function(c){return false}).hide().appendTo(ah||document.body).attr(“target”,”[aA?”width”:”height”[aA?”width”:”height”*Math.abs(ap.position()[aA?”left”:”top”]-ax)/(Math.abs(aC-0.5)-aD)}else{ax=aw*aD),0),1);ay=-U