[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

Html / javascript to image file

Hi I don;t know if this is possible, but I need to be able to generate a file from the code attached that is either a gif, jpeg or png.

The reason why is that I have an ad that we need to serve through our adserver, however the created code can only be served as an image file.  Failing that we could serve an internal redirect.

The question is how do i save this file so that I can do this?

Thanks

<html>
<head>

<style type="text/css">
.expandable
{
   position:absolute;
   left: 0;
   top: 0;
   width: 300;
   height: 50;
   background-image: url("http://www.clickbrokers.net/ad/001.gif");
   z-index:2;
   visibility:visible;
}
.expanded
{
   position:absolute;
   left: 0;
   top: 0;
   width: 300;
   height: 250;
   background-image: url("http://www.clickbrokers.net/ad/002.jpg");
   z-index:2;
   visibility:visible;
}
</style>

<script language="JavaScript">
function GrowBanner()
{
   if(document.getElementById("banner").className=='expanded')
       Clickthru();
   else
       document.getElementById("banner").className='expanded';
}

function ShrinkBanner()
{
   document.getElementById("banner").className='expandable';
}
function Clickthru()
 {  
    parent.location='http://www.radissonblu.com/shortbreaks';
 }
</script>

</head>

<body>
<span class="expandable" id="banner" onClick="GrowBanner();" onMouseout="ShrinkBanner();"> </span>
</body>

</html>

Open in new window

0
eezar21
Asked:
eezar21
1 Solution
 
EMB01Commented:
There is no way to do interaction i.e. expand, shrinkBanner using just a jpg, gif or png.  However, you could do this with flash.  Most adserver networks allow the use of flash banners.  You can often put in your own custom HTML, too...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now