Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Position relative ignored in innerHTML
Message
From
26/02/2017 06:21:46
 
 
To
26/02/2017 02:03:27
General information
Forum:
CSS
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01648528
Message ID:
01648532
Views:
23
fore vfp users this the same code (or nearly) but built from vfp.
*The same  example using DOM syntaxe (as vfp OOP) to traverse document CSS styles
*Important:run vfp9 as admin or uncheck ie protected mode in internet options/security tab settings.

Local m.myvar
TEXT to m.myvar noshow
<div id="odiv">
<h2>This is a div  with an absolute position</h2>
<img src="https://www.levelextreme.com/thread/00079336.jpg" width='150' height='150'>
<p id="yb1" >With absolute positioning, any element can be placed anywhere on a page. The div below is placed 300px from the left of the page and 350px from the top of the page.
All styles can be done with DOM syntax (even out of javascript ,from visual foxpro codings).
for more info:can search in  https://www.w3schools.com/   (very usefull).
</p>
</div>

<hr>

<div id='yb'></div>

ENDTEXT
Set Safe Off
Local m.lcdest
m.lcdest=Addbs(Sys(2023))+"ytemp.html"
Strtofile(m.myvar,m.lcdest)

Declare Integer BringWindowToTop In user32 Integer
*Important: run vfp9 as administrator if ie protected mode setting checked (internet options/secutity TAB)
Local apie
apie=Newobject("internetexplorer.application")
With apie
	.Navigate(m.lcdest)
	.Width=Sysmetric(1)
	.Height=Sysmetric(2)
	.Top=0
	.Left=0
	BringWindowToTop(.HWnd)
	.Visible=.T.
	Inke(2)  &&transitionnings
	Local x,Y
	With .Document
		x=.getElementByID("odiv").innerhtml
		Y=.getElementByID("yb")
		with y
		Y.innerhtml=x
		.Style.Border="thick solid maroon"
               .style.borderWidth = "10px 10px 10px 10px"
		.Style.padding="5px"
		.Style.position ="absolute"
		.Style.Left="300px"
		.Style.Width="350px"
		.Style.backgroundcolor="bisque"
		endwith
	Endwith

Endwith
Previous
Reply
Map
View

Click here to load this message in the networking platform