Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23

Thread: shadow on imgs

  1. #21
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Now I have a more 3-d look for it:
    Code:
    <html>
    <head>
    <script type="text/javascript">
    var depth = 5 // in pixels
    onload = function() {
    var a = document.all? document.all : document.getElementsByTagName('*');
    for (var i = 0;i < a.length;i++) {
    	if (a[i].className == "shadow") {
    		for (x = 0;x < depth;x++) {
    			var newSd = document.createElement("DIV")
    			newSd.className = "shadow2"
    			newSd.style.width = a[i].offsetWidth
    			newSd.style.height = a[i].offsetHeight
    			newSd.style.left = a[i].offsetLeft + x
    			newSd.style.top = a[i].offsetTop + x
    			document.body.appendChild(newSd)
    			}
    		}
    	}
    }
    </script>
    <style type="text/css">
    .shadow {
    border:1px solid silver;
    padding:2px;
    font:10pt arial;
    position:relative;
    display:inline;
    background:white;
    z-index:100
    }
    .shadow2 {
    overflow:hidden;
    background:black;
    position:absolute;
    filter:alpha(Opacity=15);
    opacity:0.2;
    -moz-opacity:0.2;
    -khtml-opacity:0.2;
    z-index:0
    }
    </style>
    </head>
    <body>
    <div class="shadow">Test 1</div>
    <br><br><div class="shadow">Test Number 2</div>
    <br><br><a href="#" class="shadow">Link Test</a>
    </body>
    </html>
    I think it's pretty cool
    Last edited by mburt; 01-07-2007 at 11:56 PM.
    - Mike

  2. #22
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    807
    Thanks
    87
    Thanked 2 Times in 2 Posts

    Default

    http://galaxydefense.ga.funpic.org/w...ign/shadow.htm

    Something I found in this forum. Suits me perfectly !

  3. #23
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Lol, that's my script (with a couple of modifications), which I just posted
    - Mike

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
  •