Jump to content

scott100

Members
  • Posts

    1,819
  • Joined

  • Last visited

Everything posted by scott100

  1. <img src="1.jpg" style="position:absolute;top:100px;left:100px" /><img src="2.jpg" style="position:absolute;top:200px;left:200px" /><img src="3.jpg" style="position:absolute;top:300px;left:300px" /><img src="4.jpg" style="position:absolute;top:400px;left:400px" />
  2. Chocolate570's example worked fine for me An alternative to an alert box could be a floating divcreate a floating div that appears when the mouse is over the character (onmousemove) and disappears when you move off the character (onmouseout), the message can go inside the div.
  3. scott100

    Calculator

    This shoud do what you asked for I put it into a table aswell to make it a bit neaterIf you want to perform calculations on your page then it would be a good idea for you to learn a scripting language like javascript... <html><head><title>Woodcutting Calculator!</title><script language="JavaScript">function calculate(){var a=0;var b=0;var LC=document.getElementById('LogsCut').value;var SA=document.getElementById('SoldAt').value;a=LC*SA;document.getElementById('Total1').value="£ "+a.toFixed(2); var Tree=document.getElementById('TreeType').value;if (Tree=="Normal")b=25;else if (Tree=="Oak")b=37.5;else if (Tree=="Willow")b=62.5;else if (Tree=="Teak")b=85;else if (Tree=="Maple")b=100;else if (Tree=="Mahogany")b=125;else if (Tree=="Yew")b=175;else if (Tree=="Magic")b=250;else alert("Problems with dropdown");b=b*LCdocument.getElementById('Total2').value="£ "+b.toFixed(2); }</script></head><body><form><table border="0"><tr><td>Number of Logs Cut: </td><td><input type="text" id="LogsCut"><td></tr><tr><td>Sold at: </td><td><input type="text" id="SoldAt"></td></tr><tr><td>Type of Tree Cut:</td><td><select id="TreeType"><option value="Normal">Normal<!-- Normal is equal to 25 --><option value="Oak">Oak<!-- Oak is equal to 37.5 --><option value="Willow">Willow<!-- Willow is equal to 62.5 --><option value="Teak">Teak<!-- Teak is equal to 85 --><option value="Maple">Maple<!-- Maple is equal to 100 --><option value="Mahogany">Mahogany<!-- Mahogany is equal to 125 --><option value="Yew">Yew<!-- Yew is equal to 175 --><option value="Magic">Magic<!-- Magic is equal to 250 --></select></td></tr><td><td> </td></tr><tr><td colspan="2"><input type="button" value="Calculate!" onclick="calculate()"></td></tr><td><td> </td></tr><tr><td>Number of Logs Cut x Sold at: </td><td><input type="text" id="Total1"><td></tr><tr><td>Sold at x Type of Tree Cut: </td><td><input type="text" id="Total2"></td></tr><table></form></body></html>
  4. Are you nuts Sound like a toughie, lets see it if you ever manage
  5. wicked code aspnetguy, well in how'd u become king of vegas???
  6. I have a copy the script you are talking but it only works with internet explorer but any case even if you used this script people can still get ur pictures.1) use the print screen button2) pictures are loaded into the pc cache and can be access on the local diskAs far as i know there is no way of stopping people getting a picture from your website, you may give them extra work but they will get it one way or another.
  7. You can do this with JavaScript but you should use css for page appearance.<html><head><style type="text/css">a:link {color: black;text-decoration: underline}a:visited {color: black;text-decoration: underline;}a:hover {color: red;text-decoration:none}a:active {color: red;text-decoration:none}</style></head><body><p><b><a href="#">This is a link</a></b></p></body></html>
  8. Is this what you are needing? <html><head><title></title><script language="JavaScript" type="text/javascript">function keyPress() { window.document.onkeydown=findKey;}function findKey(evt) { var evt = (evt) ? evt : ((window.event) ? event : null); if (evt.type == 'keydown') { var charCode = (evt.charCode) ? evt.charCode : evt.keyCode; if (charCode == 13)alert ("You have hit the enter key"); }}</script></head><body onload="keyPress()">Edit the text and click enter<br /></body></html>
  9. To check the Navigator Object you need a browser that supports JavaScript, so if a browser doesn't support JavaScript you can't access that object... In any case i've had a look at the properties of that object and none include turning JavaScript on in any way. Say for example i had turned off JavaScript for a reason, then visited your site and it's turned back on without my say so, i wouldn't be happy with you interfering with my settings Plain and simple if you want to notify a user that they don't have JavaScript enabled you have to use the <noscript> tag, that's what it's there for
  10. Have a look at this page:http://www.dynamicdrive.com/dynamicindex4/flyimage.htm
  11. try this: if(mutu < 52){document.getElementById('pic').style.display="none";}
  12. Use the code i gave u it works fine...
  13. put the image in the page as normal,give it an id and set it's display to none<img src="lotad.gif" id="pic" style="display:none">when the variable is above 52 use javascript to make the image appeardocument.getElementById('pic').style.display="block";
  14. 1. The body cannot be in the head of a document, they are both separate2. You were calling the clock function from within itself using settimeout, i think that's where the error was coming from, try calling it from the body using a setinterval <html><head> <title></title><script language="JavaScript" type="text/javascript">function clock() { var now = new Date(); var hh = now.getHours(); var mm = now.getMinutes(); var ss = now.getSeconds(); if (mm<10) { document.clock.time.value=hh+":0"+mm; } else { document.clock.time.value=hh+":"+mm; } if (ss<10){ document.clock.time.value=document.clock.time.value+":0"+ss; } else { document.clock.time.value=document.clock.time.value+":"+ss; }}</script></head><body onload="window.setInterval('clock();',1000);"> <form name="clock" id="clock"> <input type="text" name="time" /> </form></body></html>
  15. One way to do this in JavaSript is to use Math.random() then check the number in an if statement, each different if statement writes a different image to the page backgroundbut theres probably a ton of other ways, this was just of the top of the head.<script>var rand_int=Math.floor(Math.random()*3);if(rand_int==0){document.write('<style>body{background-image:url(http://www.google.co.uk/intl/en_uk/images/logo.gif);}</style>');}else if(rand_int==1){document.write('<style>body{background-image:url(http://us.i1.yimg.com/us.yimg.com/i/ww/beta/y3.gif);}</style>');}else if(rand_int==2){document.write('<style>body{background-image:url(http://w3schools.invisionzone.com/style_images/w3sbanner.gif);}</style>');}else alert("Problem with random number");</script>
  16. I think this is what you want, credit goes out to dynamicdrive.com <body>hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />hello<br /><script>if (!document.layers)document.write('<div id="divStayTopLeft" style="position:absolute">')</script><layer id="divStayTopLeft"><!--EDIT BELOW CODE TO YOUR OWN MENU--><table border="1" width="130" cellspacing="0" cellpadding="0"> <tr> <td width="100%" bgcolor="#FFFFCC"> <p align="center"><b><font size="4">Menu</font></b></td> </tr> <tr> <td width="100%" bgcolor="#FFFFFF"> <p align="left"> <a href="http://www.google.com">Google</a><br /> <a href="http://www.yahoo.com">Yahoo</a><br /> <a href="http://www.w3schools.com/">w3schools</a><br /> </tr></table><!--END OF EDIT--></layer><script type="text/javascript">/*Floating Menu script- Roy Whittle (http://www.javascript-fx.com/)Script featured on/available at http://www.dynamicdrive.com/This notice must stay intact for use*///Enter "frombottom" or "fromtop"var verticalpos="frombottom"if (!document.layers)document.write('</div>')function JSFX_FloatTopDiv(){ var startX = 3, startY = 450; var ns = (navigator.appName.indexOf("Netscape") != -1); var d = document; function ml(id) { var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id]; if(d.layers)el.style=el; el.sP=function(x,y){this.style.left=x;this.style.top=y;}; el.x = startX; if (verticalpos=="fromtop") el.y = startY; else{ el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight; el.y -= startY; } return el; } window.stayTopLeft=function() { if (verticalpos=="fromtop"){ var pY = ns ? pageYOffset : document.body.scrollTop; ftlObj.y += (pY + startY - ftlObj.y)/8; } else{ var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight; ftlObj.y += (pY - startY - ftlObj.y)/8; } ftlObj.sP(ftlObj.x, ftlObj.y); setTimeout("stayTopLeft()", 10); } ftlObj = ml("divStayTopLeft"); stayTopLeft();}JSFX_FloatTopDiv();</script></body>
  17. I would definently go for JavaScript, main reason being that it works on all major browsers like IE, Firefox, Opera - VBScript only works on IE because it's from microsoft.
  18. Yes, check() is a javascript function, javascript can make web pages more interactive and less static.If your familiar with (X)HTML then your next step could be to learn a scripting language, i'd recommend you check out the free tutorials on the w3schools site here: http://www.w3schools.com/js/default.asp
  19. This should do the trick<html><head><script language="JavaScript" type="text/javascript">//<![CDATA[function setAlarms() { document.bgColor="black"; window.setTimeout('document.bgColor="white"',2*1000);}//]]></script></head><body onload="setAlarms();"></body></html>
  20. scott100

    Font families

    As far as i know CSS2/3 allows for downloadable fonts, i have never used it before but i searched google and got this page, it may help you:http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/
  21. Well it wouldn't be the first time would it!!
  22. Im using IE 6 s pack 2i checked it in FF and Opera and it looks fine though...
  23. It becomes all messed up when you resize the browser window.
  24. Yes, just add a top to the style:<table class="menu" id="tutorials" width="120" style="left:90px;top:35px">
  25. use a document.write()<script>document.write('<img src="image.gif">');</script>
×
×
  • Create New...