anonīms Posted January 27, 2009 Report Share Posted January 27, 2009 function showFriends(p1,p2){ $('#'+p1).show(); $('#'+p2).hide(); } <div class="tab2"><a href="java script:void(0);" onclick="showFriends('visitors','friends');" class="current">Visitors</a></div> <div class="tab2"><a href="java script:void(0);" onclick="showFriends('friends','visitors');">Friends</a></div> <div style='text-align:left; padding-left: 3px;' id="friends">friends</div> <div style='text-align:left; padding-left: 3px;display: none;' id="visitors">visitors</div> Kapēc nekas nenotiek? Spiežot uz linka nekas nemainas. Link to comment Share on other sites More sharing options...
martins256 Posted January 27, 2009 Report Share Posted January 27, 2009 Izskatās, ka izmanto jquery. jquery ir ielādēts? firebug rāda kkādus errorus? Link to comment Share on other sites More sharing options...
the_mobix Posted January 27, 2009 Report Share Posted January 27, 2009 (edited) Drīzāk jau a elementiem šajā gadījumā būtu jāizskatās tā: <a href="java script:showFriends('visitors','friends')">Visitors</a> Īsāk, skaistāk un pareizāk Edited January 27, 2009 by the_mobix Link to comment Share on other sites More sharing options...
mefisto Posted January 27, 2009 Report Share Posted January 27, 2009 Nu ja tu gribi skaistāk, tad JS btu jāparādās tikai kā ārējam failam. Un ko parāda Firebug ? Vai operas error console ? Link to comment Share on other sites More sharing options...
Recommended Posts