我正在使用bootstrap tabbable并生成此href, 如何手动生成相同的href,以便我可以用来选择这个锚?
preload: function() {
game.load.image('background', 'http://s1.postimg.org/nqynk9tkv/starfield.png')
game.load.image('play-back', 'http://icon-park.com/imagefiles/movie_play_black.png');
},
create: function() {
this.backgroundImg = this.game.add.tileSprite(0, 0, 500, 550, 'background')
this.gameText = game.add.text(game.world.centerX-190, game.world.centerY - 150, "Space Invaders", {
font: "60px Times New Roman",
fill: "#ccccb3",
fontWeight: "bold",
stroke: "white",
strokeThickness: 2.5
});
/* // this.gameText.anchor.setTo(0.5)
this.gameText.angle =
*/
play = game.add.sprite(120,280,'play-back')
play.scale.setTo(0.5);
game.physics.arcade.enable(play);
play.events.onInputDown.add(this.start, this);
},
update: function() {
this.backgroundImg.tilePosition.y += 5;
},
render: function() {
},
start: function() {
game.start.main('main')
}
};
<a href="../../_usercontrols/News/#tab-en" id="ctl00_ctl37_g_64b9e1ac_a392_4ca3_abaf_ac62b45c1307_ctl00_tabEN" data-toggle="tab" aria-expanded="false">
English
</a>
答案 0 :(得分:2)
您可以使用attribute selector:
$("[href*='#tab-en']")
或者,您也可以定位到id:
$('#ctl00_ctl37_g_64b9e1ac_a392_4ca3_abaf_ac62b45c1307_ctl00_tabEN')