Avatar billede kenneth-eskildsen Nybegynder
15. juni 2009 - 11:38 Der er 1 løsning

Hjælp til hjemmeside (javascript)

Hej

Jeg er igang med at lave min første hjemmeside i frontpage, men har ikke helt styr på det hele. Mit problem er at jeg har lagt et billede af en bil midt på siden og lavet et javascript udenom hvor den der står velkommen til min hjemmeside, men problemet er at når man kører siden i webbrowseren tilpasser javascriptet sig til siden og flytter sig så den ikke er udenom bilen som den skal være. Kan det lade sig gøre at fastlåse javascriptet så det altid er i samme possion uanset om siden køres med stor eller lille opløsning??

Her er siden jeg har lavet:

<html>

<head>


<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Velkommen til Stephanie & Kenneth's Hjemmeside!</title>
<script language="JavaScript">
<!--
function FP_swapImg() {//v1.0
var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_preloadImgs() {//v1.0
var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_getObjectByID(id,o) {//v1.0
var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
return null;
}
// -->
</script>
</head>
<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v"/>
<style type="text/css">
v\:* { behavior: url(#default#VML); }
</style>

<body onload="FP_preloadImgs(/*url*/'button9.jpg',/*url*/'button8.jpg',/*url*/'button24.gif',/*url*/'button23.gif',/*url*/'button69.gif',/*url*/'button68.gif',/*url*/'button4C.gif',/*url*/'button4B.gif',/*url*/'button49.gif',/*url*/'button48.gif',/*url*/'button1C7.jpg',/*url*/'button1C6.jpg')" bgcolor="#F4FFFF">
<table border="0" width="100%" id="table3">
    <tr>
        <td width="12%" height="100%">&nbsp;</td>
        <td width="74%" height="100%">

<p align="center">

<SPAN id=js4irtext style="WIDTH: 100%; "><font size="7">Stephanie &amp; Kenneth's
Hjemmeside</font></SPAN><font size="6">
<SCRIPT language="javascript" >
var from =4;               
var to = 12;                 
var speed = 1;               
var textcolor = "#aabbdd";     
var i = to;
var j = 0;pd();
function pu(){
if (!document.all)
return
if (i < to){js4irtext.style.filter = "Glow(Color=" + textcolor + ", Strength=" + i + ")";i++;theTimeout = setTimeout('pu()',speed);
return 0;}
if (i = to){theTimeout = setTimeout('pd()',speed);
return 0;}}
function pd(){
if (!document.all)
return
if (i > from)
{js4irtext.style.filter = "Glow(Color=" + textcolor + ", Strength=" + i + ")";i--;theTimeout = setTimeout('pd()',speed);
return 0;}
if (i = from){theTimeout = setTimeout('pu()',speed);
return 0;}}
</SCRIPT>
<!--</body>-->
<!--</html>-->

        </font>
        <font size="5" color="#66FF33"></font></td>
        <td width="122">&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
</table>

<script type="text/javascript">

// Add as many messages as you like
var message=new Array("Velkommen", "Til vores Hjemmeside", "Håber du finder den spændende", "God fornøjelse")

// Set the outline-color. Add as many colors as you like
var outlinecolor=new Array("#69B3FC")

// Set fillcolors 1. Add as many colors as you like
var fillcolor1=new Array("#69B3FC")

// Set fillcolors 2. Add as many colors as you like
var fillcolor2=new Array("#69B3FC")

// Set the letter marking the circle
var circlemark=new Array("*")

// Set the width of the outline
var strkweight=1

// Set the waiting time between the messages (seconds)
var pause=3

// Set the strength of the opacity (transparency of letters)
var strengthopacity="10%"

// Set the size of the circle (values range from 0.1 to 1)
var circlesize=0.6

// Always keep messages in view even if page is scrolled? (DD added option)
var keepinview="yes"

// Do not edit below this line

mytruebody=(!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body //Dynamicdrive added object

var outerwidth=mytruebody.clientWidth
var outerheight=mytruebody.clientHeight

var innerwidth=Math.floor(circlesize*outerwidth)
var innerheight=Math.floor(circlesize*outerheight)

var posleft=(outerwidth-innerwidth)/2
var postop=(outerheight-innerheight)/2.5

var path=new Array()
var i_message=0
var i_outlinecolor=0
var i_fillcolor1=0
var i_fillcolor2=0
var i_messagelength=0
var longestmessage=0
pause*=1000

var ie=document.getElementById&&document.all?1:0

for (i=0;i<=message.length-1;i++) {
if (message[i].length>longestmessage) {
longestmessage=message[i].length
}
longestmessage+=4
}

for (i=0;i<=message.length-1;i++) {

var emptyspace=""
var i_emptyspace=(longestmessage-message[i].length)/2
for (ii=0;ii<=i_emptyspace;ii++) {
emptyspace+=circlemark
}
message[i]=emptyspace+" "+message[i]+" "+emptyspace
}

function changeform() {
if (keepinview=="yes") //DD added
document.getElementById("roofid").style.top=mytruebody.scrollTop //DD added
if (i_outlinecolor >= outlinecolor.length) {i_outlinecolor=0}
if (i_fillcolor1 >= fillcolor1.length) {i_fillcolor1=0}
if (i_fillcolor2 >= fillcolor2.length) {i_fillcolor2=0}
document.getElementById('strokeid').color=outlinecolor[i_outlinecolor]
document.getElementById('fillid').color=fillcolor1[i_fillcolor1]
document.getElementById('fillid').color2=fillcolor2[i_fillcolor2]
if (i_message < message.length) {tick()}
else {document.getElementById('textpathid').string=""
document.getElementById("roofid").style.display="none" //DD added
}
}

function tick() {
if (i_messagelength <= message[i_message].length) {
var messagestringend=""
var messagestring=message[i_message].substring(0, i_messagelength)+messagestringend
document.getElementById('textpathid').string=messagestring
var timer=setTimeout("tick()",50)
i_messagelength++
}
else {
clearTimeout(timer)
i_messagelength=0
i_message++
i_outlinecolor++
i_fillcolor1++
i_fillcolor2++
var timer=setTimeout("changeform()",pause)
}

}

if (ie) {
document.write('<div id="roofid" style="position:absolute;left:0px;top:0px;width:'+outerwidth+'px;height:'+outerheight+'px;overflow:hidden;">')
document.write('<v:oval id="tc" style="position:absolute;top:'+postop+'px;left:'+posleft+'px;width:'+innerwidth+'px;height:'+innerheight+'px">')
document.write('<v:shadow on="t" opacity="'+strengthopacity+'"/>')
document.write('<v:stroke id="strokeid" weight="'+strkweight+'pt" color="blue"/>')
document.write('<v:fill id="fillid" on="True" color="'+fillcolor1[0]+'" color2="'+fillcolor2[0]+'" opacity="'+strengthopacity+'" opacity2="'+strengthopacity+'" type="gradient"/>')
document.write('<v:path textpathok="t"/>')
document.write('<v:textpath id="textpathid" on="t" id="mytp" style="font-family:\'Arial Black\'; " fitpath="t" string=""/>')
document.write('</v:oval></div>')
if (window.attachEvent) //DD added code
window.attachEvent("onload", changeform) //DD added code
else
window.onload=changeform
}
</script>


<table border="0" width="100%" id="table1" height="472">
    <tr>
        <td width="25%" height="100%" rowspan="2">
<a href="Billeder.htm">
<img border="0" id="img1" src="button7.jpg" height="30" width="150" alt="Billeder" fp-style="fp-btn: Glow Capsule 1; fp-font-size: 12; fp-orig: 0" fp-title="Billeder" onmouseover="FP_swapImg(1,0,/*id*/'img1',/*url*/'button8.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img1',/*url*/'button7.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img1',/*url*/'button9.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img1',/*url*/'button8.jpg')"></a><p>
<a href="Stephanie.htm">
<img border="0" id="img3" src="button22.gif" height="30" width="150" alt="Stephanie" onmouseover="FP_swapImg(1,0,/*id*/'img3',/*url*/'button23.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img3',/*url*/'button22.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img3',/*url*/'button24.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img3',/*url*/'button23.gif')" fp-style="fp-btn: Glow Capsule 1; fp-font-size: 12; fp-transparent: 1; fp-orig: 0" fp-title="Stephanie"></a></p>
<p>
<a href="Kenneth.htm">
<img border="0" id="img4" src="button67.gif" height="30" width="150" alt="Kenneth" onmouseover="FP_swapImg(1,0,/*id*/'img4',/*url*/'button68.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img4',/*url*/'button67.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img4',/*url*/'button69.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img4',/*url*/'button68.gif')" fp-style="fp-btn: Glow Capsule 1; fp-font-size: 12; fp-transparent: 1; fp-orig: 0" fp-title="Kenneth"></a></p>
<p>
<a href="tilsalg.htm">
<img border="0" id="img5" src="button4A.gif" height="30" width="150" alt="Til Salg" onmouseover="FP_swapImg(1,0,/*id*/'img5',/*url*/'button4B.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img5',/*url*/'button4A.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img5',/*url*/'button4C.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img5',/*url*/'button4B.gif')" fp-style="fp-btn: Glow Capsule 1; fp-font-size: 12; fp-transparent: 1; fp-orig: 0" fp-title="Til Salg"></a></p>
<p>
<a href="Kontakt.htm">
<img border="0" id="img6" src="button47.gif" height="30" width="150" alt="Kontakt" fp-style="fp-btn: Glow Capsule 1; fp-font-size: 12; fp-transparent: 1; fp-orig: 0" fp-title="Kontakt" onmouseover="FP_swapImg(1,0,/*id*/'img6',/*url*/'button48.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img6',/*url*/'button47.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img6',/*url*/'button49.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img6',/*url*/'button48.gif')"></a></p>
<p>
<a href="Links.htm">
<img border="0" id="img2" src="button1C5.jpg" height="30" width="150" alt="Links" onmouseover="FP_swapImg(1,0,/*id*/'img2',/*url*/'button1C6.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img2',/*url*/'button1C5.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img2',/*url*/'button1C7.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img2',/*url*/'button1C6.jpg')" fp-style="fp-btn: Glow Capsule 1; fp-font-size: 12; fp-orig: 0" fp-title="Links"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>
        </td>
        <td height="100%" width="47%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<p align="right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <img border="0" src="fiat500g.jpg" width="272" height="207">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        </p>
        </td>
        <td height="100%" width="22%">
        <p align="left">&nbsp;</td>
        <td height="100%" rowspan="2" width="100%">&nbsp;</td>
        <td height="100%" rowspan="2" width="100%">&nbsp;</td>
    </tr>
    <tr>
        <td height="100%" width="69%" colspan="2">&nbsp;</td>
    </tr>
    <tr>
        <td width="25%" height="100%">&nbsp;</td>
        <td width="69%" colspan="2" height="100%">&nbsp;</td>
        <td width="100%" height="100%">&nbsp;</td>
        <td width="100%" height="100%">&nbsp;</td>
    </tr>
    <tr>
        <td width="25%" height="100%">&nbsp;</td>
        <td width="69%" colspan="2" height="100%">&nbsp;</td>
        <td width="100%" height="100%">&nbsp;</td>
        <td width="100%" height="100%">&nbsp;</td>
    </tr>
    <tr>
        <td width="25%" height="100%">&nbsp;</td>
        <td width="69%" colspan="2" height="100%">&nbsp;<p>&nbsp;</td>
        <td width="100%" height="100%">&nbsp;</td>
        <td width="100%" height="100%">&nbsp;</td>
    </tr>
</table>
<table border="1" width="100%" id="table2">
    <tr>
        <td width="100%" height="100%">
<marquee bgcolor="#69B3FC" scrolldelay="1" scrollamount="3">Her på siden kan du læse lidt om os og vores interesser.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Du kan blandt andet følge med i hvordan arbejdet skrider frem med vores fiat 500.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Og se billeder fra de sidste fester, samt meget meget mere.....</marquee></td>
    </tr>
</table>

</body>

</html>
Avatar billede kenneth-eskildsen Nybegynder
10. september 2013 - 21:20 #1
1
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester