Banner popout

hello there, i am having major difficulty’s. i’m trying to get this code

<div align="right" style="border:0px solid red">
<a href="javascript:;" onClick="window.open('http://urban-radio.co.uk/radio.html','wimpyMP3player','width=480,height=140')"><img src="http://urban-radio.co.uk/radioimages/listenlive.gif" border="0" align="top"></a>
    </div>
</div>

onto this banner

Banner Img

and i want to position it as well?

if anyone can help that would be great. many thanks

Hi @Urban8_Staff! Well technically this would be possible like

var newWindow = window.open('frame.html', 'frame');
var style = document.createElement('style');

style.textContent = 'body {background-image:  ' +
    'url("http://urban-radio.co.uk/wp-content/' +
        'themes/neongame/images/banner.jpg")} ' +
    '/* Add further styles here */';

// Workaround to wait for the new window to be loaded
setTimeout(function() {
    newWindow.document.head.appendChild(style);
}, 1000);

… although this is rather messy, and it only works if the source for the new window is on the same domain. I think your best bet would be to write a complete dedicated page where you embed that player in an iframe or something, and then open this page in a new window.

is this css by chance

Ah sorry I assumed this was (partly) a JavaScript question since you’re using JS to open that new window. ^^ Anyway, if you’re writing a dedicated popup page as I suggested above you don’t need any additional JS.

is there anyway that it can work in css

Not from another window.

ok but ive managed to get the popout player on a coloured background

<!DOCTYPE html>
<html>
<head>
<style>
body

h1 {
background: #00ff00;
}

}
</style>
</head>
<body>
<h1><div align="center" style="border:0px solid red">
<a href="javascript:;" onClick="window.open('http://urban-radio.co.uk/radio.html','wimpyMP3player','widt…')"><img src="http://urban-radio.co.uk/radioimages/listenlive.gif" border="0" align="top"></a>
</div>
</div></h1>
</body>
</html>

but how do i put my banner behind that image

I may have misunderstood your question. Are you just trying to put that CTA on the banner image?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.