SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Jun 2002
    Location
    Wiltshire, England
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Expandable Banners

    Hey guys ive been looking around the net for the script for expanadble banners like on the top ofMSN uk
    but havnt found any.

    Is anyone using these types of banner and if so could they show me how.

    Thanks

    Bigstu

  2. #2
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    document.getElementById("element").style.width=variable

    I couldn't see what you wanted from the link but try.....

    document.getElementById("element").style.width=variable

    if you want to change size of pic try the above, the element being the banner pic.
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  3. #3
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "...been looking around the net for the script for expandable banners..." ???
    Why look around when you have the script at MSN?

    The div with the ad:
    Code:
    <DIV style="WIDTH: 468px; HEIGHT: 60px">
      <TABLE onmouseover=adDoDrop(this); style="CLIP: rect(auto auto 60px auto); POSITION: absolute" onmouseout=adUnDoDrop(this); cellSpacing=0 cellPadding=0 border=0>
        <TBODY>
          <TR>
            <TD>
              <A href="http://ad.uk.doubleclick.net/...blahblahblah">
                <IMG height=560 alt="" src="http://ad.uk.doubleclick.net/723398/MB036_TooBig.gif" width=468 border=0>
              </A>
            </TD>
          </TR>
        </TBODY>
      </TABLE>
    </DIV>
    The javascript functions:
    Code:
    var adMousedOver = 0;
    function adDoDrop (obj)
    {
      adtechhideElement('SELECT');
      obj.style.clip='rect(auto)'; 
      if (adMousedOver == 0) {adMousedOver = 1;}
    }
    function adUnDoDrop (obj) 
    {
      adtechshowElement('SELECT'); 
      obj.style.clip='rect(auto, auto, 60, auto)';
    }	
    function adtechhideElement(elmID) 
    {
      for (i = 0; i < document.all.tags(elmID).length; i++)
      {
        obj = document.all.tags(elmID)[i]; 
        if (! obj || ! obj.offsetParent) continue;
        obj.style.visibility = "hidden";
      }
    }
    function adtechshowElement(elmID) 
    {
      for (i = 0; i < document.all.tags(elmID).length; i++)
      {
        obj = document.all.tags(elmID)[i]; 
        if (! obj || ! obj.offsetParent) continue;
        obj.style.visibility = "";
      }
    }
    Very simple; you have an image that's too big and change the clipping on mouse over/out


    The adtechhideElement() stuff is just to hide select elements (if there are any), because you can't set z-index for these, but you want them to appear "behind" the ad
    Last edited by jofa; Dec 13, 2002 at 20:07.

  4. #4
    SitePoint Zealot
    Join Date
    Jun 2002
    Location
    Wiltshire, England
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cheers i'll give that a go


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •