为标签略微调整标记,并将标识更改为类以进行样式设置:
City Gallery
London
London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.
Paris
Paris, France's capital, is a major European city and a global center for art, fashion, gastronomy and culture. Its picturesque 19th-century cityscape is crisscrossed by wide boulevards and the River Seine.
和jQuery部分:
$(document).ready(function () {
$('.nav ul li:first').addClass('active');
$('.tab-content:not(:first)').hide();
$('.nav ul li a').click(function (event) {
event.preventDefault();
var content = $(this).attr('href');
$(this).parent().addClass('active');
$(this).parent().siblings().removeClass('active');
$(content).show();
$(content).siblings('.tab-content').hide();
});
});