简体   繁体   中英

How to highlight selected link in panel of jquery mobile?

I'm have a jquery mobile page with navigation menu in a sliding panel. It's working quite well, but want to improve the navigation by highlighting the selected link in the navigation.

Usually i would use a class like ".selected", etc.

Why it doesn't work here?

$('#navlist a').click(function() {
    $('#navlist a').removeClass('selected');
    $(this).addClass('selected');
});

http://jsfiddle.net/5TDg9/ptuX7/

its probably having some conflict. you can just use !important

http://jsfiddle.net/ptuX7/3/

.selected { color: red !important; }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM