求助各位大佬
我这里有一个脚本,在 body 标签上添加一个 ID
这是我看到的结果
<body id="xxx-cat">
使用我在下面使用的脚本
<script>
$(document).ready(function(){
// Edit xxx-cat to match desired category link id:
$('body').attr("id","xxx-cat");
if ($('body[id]')) {
var bid = $("body").attr("id");
// Keep the next command on one line
$('div.droplinebar li a[class='+bid+']').addClass('current');
}
})
</script>
我如何制作 ID (1,2,3,4),因为我有 4 页并且想要它
<body id="1"> for the home page
<body id="2"> for the about
<body id="3"> for the clients
<body id="4"> for the contact
顺便说一下,这是一个 tumblr 自定义页面,这里不能使用 PHP