image
image

Go Back   macosx.com > Design, Media, Programming & Scripting > Software Programming & Web Scripting

Reply
 
LinkBack Thread Tools
  #1  
Old May 6th, 2005, 11:29 AM
andehlu's Avatar
this modern love
 
Join Date: Feb 2004
Location: torontoCANADA
Posts: 244
Thanks: 0
Thanked 0 Times in 0 Posts
andehlu is on a distinguished road
javascript to position absolute div

Does anyone know how to position an absolte div using javascript? I have the following code so far but it doesnt seem to work... i tried taking the top and left attributes out of the inlkine style and that didnt work either.... thanks

PHP Code:
<html>
<
head>

<
title>2005 YOPLAIT Minigo Duo Campaign – Online Advertising</title>
    
<
script>
function 
handle_div(){
    
document.getElementById('div_layer').top 345;
    
document.getElementById('div_layer').left 345;
}
</script>

</head>
<body onLoad="handle_div()">

body content

<div id="div_layer" style="position: absolute; left: 400; top: 100; width: 200; height: 200; z-index: 1; visibility: visible;">
    <img src="media/animated.gif">
</div>
    
</body>
</html> 
__________________
site | blog | garageband experiments
Reply With Quote
  #2  
Old May 6th, 2005, 11:41 AM
andehlu's Avatar
this modern love
 
Join Date: Feb 2004
Location: torontoCANADA
Posts: 244
Thanks: 0
Thanked 0 Times in 0 Posts
andehlu is on a distinguished road
the fix:

document.getElementById('div_layer').style.pixelLeft = 200;
__________________
site | blog | garageband experiments
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading external pages/seperate pages in a div HateEternal Design & Media 13 February 27th, 2005 08:29 PM
DIV background colors Perseus Design & Media 3 September 6th, 2004 12:57 PM
Omniweb updated edX Mac OS X System & Mac Software 1 February 9th, 2003 11:23 AM
SimX's JavaScript & Frame problem thread, 2 fryke Mac OS X System & Mac Software 0 July 8th, 2002 08:40 PM


All times are GMT -5. The time now is 05:24 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2010 DigitalCrowd, Inc.