0

Hello!

I would like to create a clickable backround for my IPB forum board.
It will act as a banner and when clicked, it will redirect to the advertiser webpage.

Here's the AdOcean demo of what I would like to create:

http://demo.adocean-global.com/main.php?x=BI&y=Background%20Image

Please, give any advice on how to implement such function on IPB board.

Thanks in advance!

Edited by pritaeas: Changed link. We use markdown, NOT BBCode.

3
Contributors
2
Replies
25
Views
3 Years
Discussion Span
Last Post by EvolutionFallen
0

I went to the page and did not see a clickable background; it may be that the page has been updated.

0

I didn't see a clickable background on the linked page either.
If I had to do such a thing, I would probably create a DIV as the first thing inside the BODY,

<body>
    <div id="clickable-bg"></div>

and set its styles to

position: fixed;
width: 100%;
height: 100%;
cursor: pointer;
background: transparent url('path/to/img.jpg') no-repeat 0 0;
z-index: 0; /*EDIT*/

Then use javascript to add a click event to the div (using jQuery here)

$(function() {
    $('#clickable-bg').click(function() {
        window.location = 'your/URL/here.html';
    }
});

EDIT:
You would also need to add a z-index to this div, as well as your main content div and anything you want appearing above this background.

Another thought, and I don't know if this would work, could be wrapping the whole div with an <a href=""> tag if you're using HTML5. This would be an alternative to the javascript. Not sure what the cross-browser implications would be.

Edited by EvolutionFallen

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.