Como su nombre indica los id deben ser únicos
id -> identificador
luego hay que tocar los scripts para que actuen sobre ellos
Código HTML:
Ver original<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
.single_news_container1,
.single_news_container2 {
display:none; /* IMPORTANT: hide all the news containers */
}
body { font-family: 'Arial'; } /* just styling */
.single_news_container h3,
.single_news_container2 h3 { padding:0px; margin:0px; margin-bottom:10px; }
#news_navigation1,
#news_navigation2{
font-size:20px;
text-align:center;
padding:5px;
background-color: #000;
color:white;
}
#all_news_container1, #all_news_container2 { padding:10px; color:black; height:200px; border:1px solid #336499;}
#wrapper, #wrapper2 { width:400px; }
<script type='text/javascript'> var scrollers_No=2;
$(document).ready(function(){
var news_No= new Array();
var prev_html = '<<';
var next_html = '>>';
for (i=1;i<=scrollers_No;i++){
$('.single_news_container'+i+':first').fadeIn(100);
$('.single_news_container'+i+':first').addClass('news_visible'+i);
news_No[i]= $('.single_news_container'+i).length;
$('#news_navigation'+i).html('<a href="javascript:prev_news('+i+');">' + prev_html + '
</a> <span id="current_news_num'+i+'">1
</span>/
<span id="max_news_num'+i+'">' + news_No[i] +'
</span><a href="javascript:next_news('+i+');">' + next_html + '
</a>');
}
});
function prev_news(scroller){
if($('.news_visible'+scroller).prev('.single_news_container'+scroller).length){
$('.news_visible'+scroller).fadeOut(100, function(){
$('.news_visible'+scroller).removeClass('news_visible'+scroller).prev('.single_news_container'+scroller).addClass('news_visible'+scroller).fadeIn(100);
var current = parseInt($('#current_news_num'+scroller).text());
if(current>1) $('#current_news_num'+scroller).text(current - 1);
});
}
}
function next_news(scroller){
if($('.news_visible'+scroller).next('.single_news_container'+scroller).length){
$('.news_visible'+scroller).fadeOut(100, function(){
$('.news_visible'+scroller).removeClass('news_visible'+scroller).next('.single_news_container'+scroller).addClass('news_visible'+scroller).fadeIn(100);
var current = parseInt($('#current_news_num'+scroller).text());
var maxNews = parseInt($('#max_news_num'+scroller).text());
if(current<maxNews) $('#current_news_num'+scroller).text(current + 1);
});
}
}
<!--START THE DIV THAT WILL WRAP IT ALL UP-->
<!--START THE DIV THAT HOLDS ALL THE NEWS CONTAINERS-->
<div id='all_news_container1'>
<!--START SINGLE NEWS CONTAINER-->
<div class='single_news_container1'>
<!--PUT THE TITLE-->
<!--AND THE CONTENT-->
<p><A HREF="http://www.megaupload.com/?d=31C787YE" TARGET="_new">http://www.megaupload.com/?d=31C787YE
</A> <A HREF="http://www.megaupload.com/?d=31C787YE" TARGET="_new">http://www.megaupload.com/?d=31C787YE
</A></p>
<!--END SINGLE NEW CONTAINER-->
<!--AND REPEAT IT HOW MUCH TIMES YOU WANT...-->
<div class='single_news_container1'> <h3>Why do we use it?
</h3>
<p><A HREF="http://www.megaupload.com/?d=31C787YE" TARGET="_new">http://www.megaupload.com/?d=31C787YE
</A> <A HREF="http://www.megaupload.com/?d=31C787YE" TARGET="_new">http://www.megaupload.com/?d=31C787YE
</A></p>
<div class='single_news_container1'> <h3>Where does it come from?
</h3> <p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur.
</p>
<div class='single_news_container1'> <h3>Where can i get some?
</h3> <p>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text.
</p>
<div class='single_news_container1'> <h3>The standard Lorem Ipsum passage, used since the 1500s
</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</p>
<!--DONE WITH SINGLE NEWS CONTAINERS-->
<!--END THE DIV THAT HOLDS ALL THE NEWS CONTAINERS-->
<!--AN EMPTY DIV WHERE JQUERY MADE NAVIGATION WILL BE-->
<div id='news_navigation1'></div>
<!--START THE DIV THAT HOLDS ALL THE NEWS CONTAINERS-->
<div id='all_news_container2'>
<!--START SINGLE NEWS CONTAINER-->
<div class='single_news_container2'>
<!--PUT THE TITLE-->
<!--AND THE CONTENT-->
<p><A HREF="http://www.megaupload.com/?d=31C787YE" TARGET="_new">http://www.megaupload.com/?d=31C787YE
</A> <A HREF="http://www.megaupload.com/?d=31C787YE" TARGET="_new">http://www.megaupload.com/?d=31C787YE
</A></p>
<!--END SINGLE NEW CONTAINER-->
<!--AND REPEAT IT HOW MUCH TIMES YOU WANT...-->
<div class='single_news_container2'> <h3>Why do we use it?
</h3> <p><A HREF="http://www.megaupload.com/?d=31C787YE" TARGET="_new">http://www.megaupload.com/?d=31C787YE
</A> <A HREF="http://www.megaupload.com/?d=31C787YE" TARGET="_new">http://www.megaupload.com/?d=31C787YE
</A></p>
<div class='single_news_container2'> <h3>Where does it come from?
</h3> <p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur.
</p>
<div class='single_news_container2'> <h3>Where can i get some?
</h3>
<p>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text.
</p>
<div class='single_news_container2'> <h3>The standard Lorem Ipsum passage, used since the 1500s
</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</p> <!--DONE WITH SINGLE NEWS CONTAINERS-->
<!--END THE DIV THAT HOLDS ALL THE NEWS CONTAINERS-->
<!--AN EMPTY DIV WHERE JQUERY MADE NAVIGATION WILL BE-->
<div id='news_navigation2'></div>
<!--END THE WRAPPING DIV-->
Seguro que hay formas mas elegantes de resolverlo... pero así funciona.