5545 sujets

Sémantique web et HTML

Bonjour ! Smiley smile

J'ai coder un splash screen mais je ne comprend par lorsque je lance mon .hta l'image est decalée par 2 bandes blanches alors que j'ai respecté mes dimension d'image ...

Vu que parfois une image vaut plus que des mots ci joint un screen du problème et le script.

Si par hasard quelqu'un aurais une idee ... Smiley langue upload/1586826257-79493-sanstitre1.jpg

<html>
<hta:application id="oHTA"
border="none"
caption="no"
contextmenu="no"
innerborder="no"
scroll="no"
showintaskbar="no"

/>
<script language="VBScript">
Sub Window_OnLoad
' Resize and position the window

width = 800 : height = 450
window.resizeTo width, height
window.moveTo screen.availWidth\2 - width\2, screen.availHeight\2 - height\2

' Automatically close the windows after 5 seconds
idTimer = window.setTimeout("vbscript:window.close", 5000)
End Sub
</script>
<body>
<table border=0 width="100%" height="100%">
<tr>
<td align="center" valign="middle">
<img src="image.jpg"/>
</td>
</tr>
</table>
</body>
</html>
Modifié par scrachy (14 Apr 2020 - 03:11)
Schwarzer Stern a écrit :
Salut, tu aurais une URL pour voir le problème en live ?


C'est un HTA, en gros c'est un fichier exécuté par IE dans une fenêtre système, donc en local, pas d'url Smiley cligne

Tu as pensé à virer le margin et le padding du body ?
Re,

Si c'est juste pour afficher une image, tu dois virer la table ( c'est ça qui met le bazar )
je t'ai refais un code propre en virant le VB, remplacé par du JS ( équivalent )


<html>

	<head>

		<HTA:APPLICATION
		border="none"
		caption="no"
		contextmenu="no"
		innerborder="no"
		scroll="no"
		showintaskbar="no"
		>

		<script>

			var ThisWidth = 800;
			var ThisHeight = 450;
			var ThisPosX = screen.width  /2 - ThisWidth / 2;
			var ThisPosY = screen.height /2 - ThisHeight / 2;
			window.resizeTo(ThisWidth, ThisHeight);
			window.moveTo(ThisPosX, ThisPosY);
			
			setInterval( closeWindow, 5000);
			
			function closeWindow () { window.close(); }
			
		</script>

		<style>

			body { margin: 0px; padding: 0px }
			
		</style>

	</head>

	<body>

		<img src="image.jpg"/>

	</body>
	
</html> 
Meilleure solution