Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Making background image a link?


la.antoniadis@gmail.com

Recommended Posts

Going to depend on where you want to place the background image what page where ??

 

never done myself was just interesting question :D

 

are you talking about the complete site background image?

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Just playing about body background

 

http://stackoverflow.com/questions/13349677/make-body-background-image-act-as-link

<script type="text/javascript">
$('body').on('click', function(e) {
    if( e.target != this ) return;
    window.location = 'http://google.com';
});
</script>
To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

yes! everywhere from the first page to every product page!!!

 

Probably a bad idea, then. Presumably you would want foreground links and buttons to take precedence over background links, and I'm not sure how deterministic this method will be. I'm also not fond of methods that use kludges like "shove the image over by 10000 pixels from its container", as they tend to be rather fragile and browser-dependent.

 

Instead of using a background image, have you looked into using a foreground image with normal links (<a> tag), possibly at a different (lower) z-index than other links and buttons? That might be a bit tricky to set up, but should be browser-independent and more reliable than the kludge discussed.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...