写个js自己把标签重组一下就好了呀,想放几个标签就几个,想哪个第一个就哪个..
我不会js,请问您可以写个代码让我做个脚本小子吗?^_^
@chuyaoxin: 嗯...不可以没有钱没有动力
@小小咸鱼YwY: 50?^_^
@chuyaoxin: 0 0,算了算了开玩笑的,等会我帮你写个吧,我这书先看完
@chuyaoxin:
<script>
var sidebar_postcategory = document.querySelector('#sidebar_postcategory');
var taps = sidebar_postcategory.querySelectorAll('a')
var new_taps ='<select class=sidebar_postcategory_select>';
for(var i =0;i<taps.length;i++){
//不知道是什么console.log(taps[i].text)
//if(taps[i].text=='你要排第一的分类(数量)'){new_taps=new_taps +'<option selected '+'value='+taps[i].href+'>'+ taps[i].text+'</option>'}
new_taps=new_taps +'<option '+'value='+taps[i].href+'>'+ taps[i].text+'</option>'
}
new_taps = new_taps+'</select>';
sidebar_postcategory.innerHTML=new_taps
//跳转
var sidebar_postcategory_select = document.querySelector('.sidebar_postcategory_select');
sidebar_postcategory_select.onchange=function () {
window.open(this.value)
}
</script>
<style>
select {
border: none;
outline: none;
}
select::-webkit-scrollbar-button{
width: 0
}
</style>
交出豆子来,我还帮你美化了一下,你看我博客全部都是我用js重构的
@小小咸鱼YwY: 好的,谢谢你