Need rollover behaviour without a link

Hello!
I am using a jquery toggle effect on 4 buttons, and want a hover behaviour on the buttons (moving the background image.)

I am currently making the div a link, with an empty <a>, but clicking on them reloads the current page, so if you have scrolled down, the page jumps back up to the top.

See the 4 buttons under ‘what we do’
T:issue | Tissue Pack Marketing in the UK

Can anyone help me with a workaround for this?

Thanks!

Claire x

What are your target browsers?

I would suggest using the :hover sudo class instead of jQuery on the divs that you want to roll over but this does not work in IE6 and can be buggy in IE7.

To stop the page bouncing, get rid of the href, anchors don’t need them if you are not linking to anything.

Edit: I see you are not using jQuery for the hover state and you are using the :hover sudo class. :hover can be used on almost all html elements as long as the browser is standards complaint. :slight_smile:

I tried it with just <a> but had the same problem (in chrome and firefox)

… do you mean I can use :hover without it being a link?

Thanks so much for the quick reply xx

Interesting, I don’t use the anchor tag like this often but I thought I used it in the past without any issues.

Yep, you do not need to chain the hover class to a link, it can be used on most html elements, but you need to test with IE because depending on the situation it can be buggy.

np :slight_smile: