mrblu
02-11-2009, 06:12 PM
Hello guys and thank you for your help with this. I'm pretty new @ Javascript so please have patience. I'm Pretty Sure this must be very easy to do but I have no idea how to begin.
I am currently using this method for making a DIV into a link
<div id="header" onclick="location.href='index.php';" style="cursor:pointer;"><a href="#"></a></div>
Works Fine but having to change 10+ pages everytime I change a banner it's not working for me anymore. So I'm thinking there must be a way of adding the <a href=""> with javascript through an external .js file on load.
Something like:
function load()
{
var bannerLink = document.createElement('a');
link.setAttribute('href', '/ontour.aspx');
document.getElementById("r-prom").appendChild(bannerLink);
}
and maybe use this (http://web-kreation.com/index.php/html-css/making-div-a-link-javascript-vs-css/) css technique to make the whole div into a link.
I really Appreciate any help I can get on this.
:cool:
I am currently using this method for making a DIV into a link
<div id="header" onclick="location.href='index.php';" style="cursor:pointer;"><a href="#"></a></div>
Works Fine but having to change 10+ pages everytime I change a banner it's not working for me anymore. So I'm thinking there must be a way of adding the <a href=""> with javascript through an external .js file on load.
Something like:
function load()
{
var bannerLink = document.createElement('a');
link.setAttribute('href', '/ontour.aspx');
document.getElementById("r-prom").appendChild(bannerLink);
}
and maybe use this (http://web-kreation.com/index.php/html-css/making-div-a-link-javascript-vs-css/) css technique to make the whole div into a link.
I really Appreciate any help I can get on this.
:cool: