Ive been trying to add a slider model to the webpage and I want to add the sliders in two different divs.. Ive tried renaming the elements and class names..bt it doesnt wrk... Is there a solution for this???is it possible to use a jquery plug in twice in same page??
I am trying to add the plugin code
var currentPosition1 = 0; var slideWidth1 = 900; var slides1 = $('.slider1'); var numberOfSlides1 = slides1.length; // Remove scrollbar in JS $('#slidesContainer1').css('overflow', 'hidden'); // Wrap all .slides with #slideInner div slides1 .wrapAll('') // Float left to display horizontally, readjust .slides width .css({ 'float' : 'left', 'width' : slideWidth1 }); // Set #slideInner width equal to total width of all slides $('#slideInner1').css('width', slideWidth1 * numberOfSlides1); // Insert controls in the DOM $('#slideshow1') .prepend('Clicking moves left') .append('Clicking moves right'); // Hide left arrow control on first load manageControls1(currentPosition1); // Create event listeners for .controls clicks $('.control') .bind('click', function(){ // Determine new position currentPosition1 = ($(this).attr('id')=='rightControl1') ? currentPosition1+1 : currentPosition1-1; // Hide / show controls manageControls1(currentPosition1); // Move slideInner using margin-left $('#slideInner1').animate({ 'marginLeft' : slideWidth1*(-currentPosition1) }); }); // manageControls: Hides and Shows controls depending on currentPosition function manageControls1(position1){ // Hide left arrow if position is first slider2 if(position1==0){ $('#leftControl1').hide() } else{ $('#leftControl1').show() } // Hide right arrow if position is last slider2 if(position1==numberOfSlides1-1){ $('#rightControl1').hide() } else{ $('#rightControl1').show() } }
in to the div Panel1
<div class="panel1">
<div id="slideshow1">
<div id="slidesContainer1">
<div class="slider1">
<table style="margin-bottom:50px;"><tbody id="facetPrsnRslt"></tbody></table>
</div>
<div class="slider1">
<p>This is the END my Friend...</p>
</div>
</div>
</div>
</div>
, there is another div panel 2, i want to add the same slider plugin in to panel2, bt no luck...