views:

38

answers:

3

I am skinning a site with an ad, and I want to make the entire ad clickable. The ad takes up the entire background (body) as shown below

body {
background-attachment:scroll;
background-color:#000000;
background-image:url("http://gunshyassassin.com/wp-content/uploads/2010/10/gunshy_takeover2OUTNOW4.jpg");
background-position:center top;
background-repeat:repeat-x;

I have used css to absolutely position the anchor, but it won''t work due to the size of the background. I am looking for a jquery script that basically says:

when you hover over the background, turn the pointer into a curser. If you click anywhere on the background, go to this link: http://google.com. BUT, if you hover over the main container, (a child of the body, obviously), disable the hover and link.

Any ideas?

+2  A: 

Impossible the way you describe it, try positioning a new banner (display: block, position: absolute; top: ..px, left: 50%; margin-left: -bannerwidth/2px;) absolute in the body

Koen
I also has to add: width:100%; overflow:hidden because the background image is larger than my monitor. Good fix though.
JCHASE11
A: 

I would create a div that (as Koen said) is absolute positioned at 0,0 and fills the screen and then add a click handler to that:

$("#fullpageadvert").click( function() {
  do stuff;
});
Steve Claridge
A: 

There is no way to do so. But you can add a dummy absolute div on the background:

#dummy{
   position: absolute;
   height: 100%;
   width: 100%;
   top: 0px;
   right: 0px;
   z-index: -1;
}
negative