Portál AbcLinuxu, 12. května 2025 05:34
Řešení dotazu:
<li class="red"> <a href="javascript:;"> <img src="services.png" /> <h3>Services</h3> <span>Lorem ipsum dolor sit amet consect</span> </a> </li>(pri li pribudol atribút class, pri druhom bude class green a pri tom treťom zase blue) Potom sa zmení css kód z
ul#tabs li a.current { background: url('feature-tab-current.png'); color: #FFF; }na niečo ako
ul#tabs li.red a.current { background: url('feature-tab-current-red.png'); color: #FFF; } ul#tabs li.green a.current { background: url('feature-tab-current-green.png'); color: #FFF; } ul#tabs li.blue a.current { background: url('feature-tab-current-blue.png'); color: #FFF; }
function slide(nr) {
if (typeof nr == "undefined") {
nr = visible_item + 1;
nr = nr >= total_items ? 0 : nr;
ja=nr;
}
//alert(nr);
//current='current'+ja;
//alert(ja);
if (nr==0) {
tabs.removeClass('current0').filter(":eq(" + nr + ")").addClass('current0');
tabs.removeClass('current1').filter(":eq(" + 1 + ")");
tabs.removeClass('current2').filter(":eq(" + 2 + ")");
}
if (nr==1) {
tabs.removeClass('current1').filter(":eq(" + nr + ")").addClass('current1');
tabs.removeClass('current0').filter(":eq(" + 0 + ")");
tabs.removeClass('current2').filter(":eq(" + 2 + ")");
}
if (nr==2) {
tabs.removeClass('current2').filter(":eq(" + nr + ")").addClass('current2');
tabs.removeClass('current1').filter(":eq(" + 1 + ")");
tabs.removeClass('current0').filter(":eq(" + 0 + ")");
}
output.stop(true, true).filter(":visible").fadeOut();
output.filter(":eq(" + nr + ")").fadeIn(function() {
visible_item = nr;
});
tvoje riešenie je krásne jednoduché a na použitie ideálne, ešte raz ďakujem.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.