fr600
06-22-2011, 12:14 AM
I'm not an expert and so my codes are huge making the file size large. There are shorter ways to do it and I don't know how and I'd really appreciate if you could help me with this.
Here's the first one, I'm providing only 6 lines but there are more:
$("#image1").click(function(){shiftH();doThis(1);});$(document).bind('keydown','1',function(){shiftH();doThis(1);});
$("#image2").click(function(){shiftH();doThis(2);});$(document).bind('keydown','2',function(){shiftH();doThis(2);});
$("#image3").click(function(){shiftH();doThis(3);});$(document).bind('keydown','3',function(){shiftH();doThis(3);});
$("#image4").click(function(){shiftH();doThis(4);});$(document).bind('keydown','4',function(){shiftH();doThis(4);});
$("#image5").click(function(){shiftH();doThis(5);});$(document).bind('keydown','5',function(){shiftH();doThis(5);});
$("#image6").click(function(){shiftH();doThis(6);});$(document).bind('keydown','6',function(){shiftH();doThis(6);});
And here's the other one from the functions shiftH an doThis:
if(n=='1'){rr='A';}
else if(n=='2'){rr='B';}
else if(n=='3'){rr='C';}
else if(n=='4'){rr='D';}
else if(n=='5'){rr='E';}
else if(n=='6'){rr='F';}
Thanks
Here's the first one, I'm providing only 6 lines but there are more:
$("#image1").click(function(){shiftH();doThis(1);});$(document).bind('keydown','1',function(){shiftH();doThis(1);});
$("#image2").click(function(){shiftH();doThis(2);});$(document).bind('keydown','2',function(){shiftH();doThis(2);});
$("#image3").click(function(){shiftH();doThis(3);});$(document).bind('keydown','3',function(){shiftH();doThis(3);});
$("#image4").click(function(){shiftH();doThis(4);});$(document).bind('keydown','4',function(){shiftH();doThis(4);});
$("#image5").click(function(){shiftH();doThis(5);});$(document).bind('keydown','5',function(){shiftH();doThis(5);});
$("#image6").click(function(){shiftH();doThis(6);});$(document).bind('keydown','6',function(){shiftH();doThis(6);});
And here's the other one from the functions shiftH an doThis:
if(n=='1'){rr='A';}
else if(n=='2'){rr='B';}
else if(n=='3'){rr='C';}
else if(n=='4'){rr='D';}
else if(n=='5'){rr='E';}
else if(n=='6'){rr='F';}
Thanks