Hello. I have slide-show images used jquery and jcarouse lite. You can see it in http://mayvanphongtmt.com/bug/hexbal.htm
I want to its auto select center picture( has difference background) in slide. Now, when I click on right arrow, it can work correct 5 times, on 6-7 times, it work incorrect. And more, when click on left arrow, only 2 times work correct. This is my code The firt, in IMG tab – It have to ID property. After that, SPAN have to ID property.
<DIV class="photo">
<IMG <b>id="2"</b> src="./Hexbal_files/1262155399heelgarde.png" width="160" height="220" class="imgSlide" alt="Heelgarde">
</DIV>
In script code, I have to get ID
of IMG
tab (in example is 2) then using javascript to set class name for SPAN
tag
<SCRIPT language="javascript" type="text/javascript">
$(".displayThumb").jCarouselLite({
btnNext: ".arowleft",
btnPrev: ".arowright",
visible:5,
beforeStart: function(a) {
var s = a[1].innerHTML; //get center picture
if(isLeft)
s=a[3].innerHTML;
var i=s.lastIndexOf("id="); //find id of img tag
if(i<0) return;
s = s.slice(i+3,i+7);
var array=s.split(" ",2) ;
s=array[0];
s=s.replace( /"/g, '' );//replace quote
document.getElementById('pro' + s).className='test_hover';//set new class name for span tag
}
});
</SCRIPT>
I don’t understand why that. Please help me. It’s very important in my project. Thank so much. PS : Sorry my English. My nick Y.H :trinhhoaithanh1905 Email:[email protected]