Anybody, about extern the css pseudo class :)
I want use a custom anchor with icon in my page,
but i cannot using "background" in anchor tag directly because im using a sprite,the code like this:
- // html
- <a href="#c1" icon="icon1">icon link1</a>
- <a href="#c2" icon="icon2">icon link2</a>
- // css
- ins{width:16px; height:16px; background-image:sprite.png; background-repeat: no-repeat;}
- .icon1{background-position:0 0}
- .icon1:hilight{background-position:0 -16}
- .icon2{background-position:-16 0}
- .icon2:hilight{background-position:-16 -16}
- // js
- $(document).ready(function()
- {
- $('a[icon]').each(function()
- {
- var iconclass = $(this).attr('icon');
- $(this).prepend('<ins class="'+iconclass +'"></ins>');
- $(this).removeAttr('icon');
- }
- }
I want: when i mouseover the link, the icon can "
hilight", many thanks for your help!