Jump to content

scott100

Members
  • Posts

    1,819
  • Joined

  • Last visited

Everything posted by scott100

  1. scott100

    Fade-In

    This only works in IE, example here: http://www.w3schools.com/dhtml/tryit.asp?f...html_pageenter4
  2. Using customised cursors only works in IE6, it would work like the code below with a .cur file extension not .gif etc<style> body{ cursor:url("yourimage.cur"); } </style>
  3. Try using a setTimout() function, call it after one song has finished playing. It should be explained in your book.Also see this similar post: http://w3schools.invisionzone.com/index.php?showtopic=2286
  4. Try this, only plays when you mouse over the image, <embed> supported by IE & NN: http://www.w3schools.com/media/media_browsersounds.asp <embed src="pig.wav" name="bgsound" autostart="false" loop="true" hidden="true"><img src="Ganon.jpg" onmouseover="javascript:document.bgsound.play()" onmouseout="javascript:document.bgsound.stop()" />
  5. scott100

    Books

    I personaly prefer to use books, and most books these days come with a supporting website where you can download the code used in the book. Plus i find that i remember the codes more if i type it in from a book rather than copying a chunk from a website.I have this book which i find really good: http://www.peachpit.com/title/0201730847
  6. Have a look at this page: http://www.htmlgoodies.com/beyond/javascri...cle.php/3458851
  7. Math.random() always creates a new number, you can check this by putting it's result in an alert message. Also, if you put it within a Math.ceil() you get whole numbers ie 1 & 6 not 0.666 & 5.32656 <head><script>var value2=0;function decrease(){ var value=Math.ceil(Math.random()*10); alert("Random number is "+value); if (value<5) { value2=value2-10; document.getElementById('val2').value=value2; } else { value2=value2-20; document.getElementById('val2').value=value2; }}</script></head><body><input type="button" value="button" onclick="decrease()" /><p>Value 2 <input type="input" value="0" id="val2" /></p></body>
  8. If you look at the full line of code i pasted previously you will see: frameborder="no"This turns off the resize bar/border
  9. You can do all these will a frame, turning off resize is possible: <frame name="top" marginheight="0" marginwidth="0" border="0" frameborder="no" scrolling="no" noresize="yes">
  10. scott100

    Hover

    This code sets the page with a different background colour and the table is always white except on mouseover, is that what you need? <body style="background:black"><table style="background:white" border="1" width="50%"><tr><td onmouseover='this.bgColor="red"' onmouseout='this.bgColor="white"'>Red</td><td onmouseover='this.bgColor="blue"' onmouseout='this.bgColor="white"'>Blue</td></tr><tr><td onmouseover='this.bgColor="green"' onmouseout='this.bgColor="white"'>Green</td><td onmouseover='this.bgColor="yellow"' onmouseout='this.bgColor="white"'>Yellow</td></tr></table>
  11. Thanks but you don't need to worry about any mentions, i'm just here to help btw, to round up your percentage use to.Fixed var a=document.getElementById('1').value;var b=document.getElementById('2').value;var c=a/d;var d= -a -b;var d= -dsum=a/d*100alert(sum.toFixed(2)+"%");
  12. There was no problem with the height, in both the problem and the solution the height is the same, 58. The whole line caused the problem, it must have contained some invisible bug!!
  13. I made it with scripting language ie javascript.The problem with the + is that it is also used for adding strings together not just addition.ie string1="hello ";string2="world";string3=string1+string2;This adds it to one string = "hello world"The same can happen with numbersnum1=5num2=5num3=num1+num2;This is turned from numbers to a string = "55" not 10I use the - sign to combat it, as - only has one meaning in javascript then reverse the final answer:<head><script>function check(){ var a=document.getElementById('1').value; var b=document.getElementById('2').value; var c=a+b; alert(a+"+"+b+"="+c);}function check2(){ var a=document.getElementById('3').value; var b=document.getElementById('4').value; sum = -a -b; sum = -sum; alert(sum);}</script></head><body><p>How <u>not</u> to add 2 numbers</p><form>1st Number <input type="text" id="1" /><br />2nd Number <input type="test" id="2" /><br /><br /><input type="button" value="submit" onclick="check()" /></form><br /><p>How to add 2 numbers</p><form>1st Number <input type="text" id="3" /><br />2nd Number <input type="test" id="4" /><br /><br /><input type="button" value="submit" onclick="check2()" /></form></body>
  14. scott100

    Table Links

    Remove the anchor tags and put an onclick on the td's:<head><style>table{ cursor:pointer;}</style></head><body><table border="1" width="50%"><tr><td onclick='window.location="http://www.google.com"'>Visit Google</td><td onclick='window.location="http://www.yahoo.com"'>Visit Yahoo</td></tr><tr><td onclick='window.location="http://www.microsoft.com"'>Visit Microsoft</td><td onclick='window.location="http://www.w3schools.com"'>Visit W3Schools</td></tr></table></body>
  15. scott100

    Hover

    Where there's a problem there's a JavaScript solution The code below should explain itself. <table border="1" width="50%"><tr><td onmouseover='this.bgColor="red"' onmouseout='this.bgColor="white"'>Red</td><td onmouseover='this.bgColor="blue"' onmouseout='this.bgColor="white"'>Blue</td></tr><tr><td onmouseover='this.bgColor="green"' onmouseout='this.bgColor="white"'>Green</td><td onmouseover='this.bgColor="yellow"' onmouseout='this.bgColor="white"'>Yellow</td></tr></table>
  16. Ok, now i understand what you need , here's the code: <script>picFollow = new Image();picFollow.src = "http://javascript.internet.com/img/mouse-bomb/bomb.gif";document.onmousemove = getMousePosition;document.onmouseout = pauseBomb;document.write("<div id=\"diva\" style=\"position:absolute\">");document.write("<img name=\"pic\"src=" + picFollow.src + "></div>");var picX = 20;var picY = 100;var step = 10;var speed = 100;var tolerance = step/2 +1;var mouseX = 0;var mouseY = 0;var mouseOut = true;var followMouse = false;function pauseBomb() {mouseOut = true;}function getMousePosition(e) {mouseX = window.event.x + document.body.scrollLeft;mouseY = window.event.y + document.body.scrollTop;mouseOut = false;if (followMouse) {diva.style.left = mouseX - pic.width / 2;diva.style.top = mouseY - pic.height / 2; }}function calcNewPos() {if (mouseX == picX)return;arg = (mouseY-picY) / (mouseX-picX);mult = 1;if (mouseX - picX < 0)mult = -1;alpha = Math.atan(arg);dx = mult * step * Math.cos(alpha);dy = mult * step * Math.sin(alpha);picX += dx;picY += dy;}function collision() {if ((Math.abs(picX-mouseX) < tolerance) && (Math.abs(picY-mouseY) < tolerance) && (!mouseOut))return true;return false;}function hideAnimation() {diva.style.visibility = "hidden";}function moveBomb() {calcNewPos();window.status = "("+mouseX+","+mouseY+")";diva.style.left = picX - pic.width / 2;diva.style.top = picY - pic.height / 2;if (collision()) {clearInterval(myInterval);followMouse = true;setTimeout('hideAnimation()', 2000);window.location="http://www.google.com" //Go to this page when bomb hits mouse }}myInterval = setInterval('moveBomb()', speed);</script><body></body>
  17. Nothin in there, it was basically the file that shows and hides the menu.I've also found this file on your page, do you have it's code handy?@import url("/dealer/newsite2006/2006_banner.css");
  18. scott100

    Font Colors

    You could use pre or but css allows you to postion elements on a page, for example set it's position to absolute then say where you want it placed on the page with the top left of the screen being 0,0 co-ordinates, have a look: <head><style>.male{ color:blue;}.female{ color:pink;}</style></head><body><p class="male">Peter</p><p class="female">Carol</p><p class="male">Stuart</p><p class="female">Lynn</p><h1 class="male">Bob</h1><h1 class="female">Linda</h1><p>This is a paragraph containing a <span class="male">male</span> and a <span class="female">female</span>.</p><div class="male" style="position:absolute;top:450px;left:500px;">I am absolute positioned male</div><div class="female" style="position:absolute;top:50px;left:200px;">I am absolute positioned female</div><div class="male" style="position:absolute;top:0px;left:300px;"><h1>I am absolute positioned male2</h1></div><div class="female" style="position:absolute;top:210px;left:20px;"><h1>I am absolute positioned female2</h1></div></body>
  19. Your not kiddin, i tried to access pics and everythings password protected That was only one width on your page that i pointed out, there are many others. I'm not sure they are the problem anymore though, i found this in the code: <script language="JavaScript1.2" type="text/javascript" src="/dealer/newsite2006/mm_css_menu.js"></script> I think it may hold the code that is causing you problems, try and paste it
  20. Your question is a good one and i don't have an answer because i don't know why it happened either, everything looked fine.If you use the same technique as i did though then it's a start. I used the process of elimination, i went through each tag deleting it and refreshing the page to see what happened. I wittled it down to that line of code and from what i could see it was ok, very strange. All i done to fix it was copy the line below it and paste it over it then change the height from 58 to 20 and it was sorted.Long and boring process? yes, but it got the job done and that's the main thing
  21. mmm, dont think its possible, try an external javascript.To elaborate a bit moreVisit this page on External JavaScripts: http://www.w3schools.com/js/js_whereto.aspPut exactly this code into the external JavaScript file you create document.write('<a href="http://www.google.com" style="text-decoration:none" onmouseover="this.innerHTML=\'[Mouseover Link]\'" onmouseout="this.innerHTML=\'Mouseover Link\'">Mouseover Link</a>')
  22. It could have something to do with the widths being set like this width="748" , to cope with resolution changes you normaly use % to use available screen width ie <table width="75%">Have you uploaded this page to a website yet, a link to it would be helpful? I can't realy see the full working page from the code you posted as i don't have these images on my pc.
  23. Hardly ever used fireworks so can't help there. If you post the code we can have a look for you though
  24. That was a real head scratcher it took me ages to find the part that was causing the problem: <tr height="20" bgcolor="#a295ac"><td></td></tr>I don't know why it wouldn't work but i managed to fix it. I have commented the problem area in the code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>SSDg® Web Design Home</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="imagetoolbar" content="no"><!-- HTML Codes Copyright ©2006 SnaykeSkyns Digi-graphix® All rights reserved. --><style type="text/css"> <!--body { margin: 0px; padding: 0px; scrollbar-base-color:#c8bfcc; scrollbar-face-color:#c8bfcc; scrollbar-track-color:#c8bfcc; scrollbar-arrow-color:#503c59; background-color: #c8bfcc; }a:link {color: #503c59; text-decoration: underline;}a:active {color: #f4f3f5; text-decoration: none;}a:visited {color: #000000; text-decoration: none;}a:hover {color: #f4f3f5; text-decoration: underline; cursor:crosshair;}p.one{font-family: tahoma,arial,helvetica;font-weight: bold;font-variant: small-caps;font-size: 18px;color: #503c59;}p.two{font-family: tahoma,arial,helvetica;font-style: regular;font-size: 12px;color: #503c59;}--></style><script type="text/javascript"><!--var msg="Go right-click yourself!";function click(e) {if (document.all) {if (event.button == 2) {alert(msg);return false;}}if (document.layers) {if (e.which == 3) {alert(msg);return false;}}}if (document.layers) {document.captureEvents(Event.MOUSEDOWN);}document.onmousedown=click;--></script></head><body><br><table cellspacing="0" cellpadding="0" width="90%" align="center" margin="0" border="0"><tr height="8" bgcolor="#503c59"><td></td></tr><tr height="2" bgcolor="#c8bfcc"><td></td></tr><tr height="3" bgcolor="#503c59"><td></td></tr><tr height="4" bgcolor="#c8bfcc"><td></td></tr><tr height="58" bgcolor="#a295ac"><td></td></tr></table><table cellspacing="0" cellpadding="4" width="92%" bgcolor="#c8bfcc" margin="0" border="0"><tr><td align="left"><p class="one"> SnaykeSkyns Digi-graphix®</p></td></tr></table><table cellspacing="0" cellpadding="0" width="90%" height="400" bgcolor="#82718c" align="center"><tr><td></td></tr></table><table cellspacing="0" cellpadding="4" width="98%" bgcolor="#c8bfcc" margin="0" border="0"><tr><td align="right"><p class="one">For unique and original web design</p></td></tr></table><table cellspacing="0" cellpadding="0" width="90%" align="center" margin="0" border="0"><tr height="20" bgcolor="#a295ac"><td></td></tr><!-- the problem was with this line - don't know why --><tr height="58" bgcolor="#a295ac"><td></td></tr><tr height="3" bgcolor="#503c59"><td></td></tr><tr height="4" bgcolor="#c8bfcc"><td></td></tr><tr height="8" bgcolor="#503c59"><td></td></tr><tr height="22" bgcolor="#a295ac"><td></td></tr></table><br><table cellspacing="0" cellpadding="0" width="90%" align="center" margin="0" border="0"><tr><td align="left"><p class="two">Copyright ©2006 SnaykeSkyns Digi-graphix® All rights reserved.</p></td><td align="right"><p class="two"><a href="mailto:snayke@gmail.com" target="_top">Contact</a></p></td></tr></table><br></body></html>
  25. scott100

    Font Colors

    Font is old skool don't use it anymore, use css and in this case classes, create one for male and one for female and then call them like so: <head><style>.male{ color:blue;}.female{ color:pink;}</style></head><body><p class="male">Peter</p><p class="female">Carol</p><p class="male">Stuart</p><p class="female">Lynn</p><h1 class="male">Bob</h1><h1 class="female">Linda</h1><p>This is a paragraph containing a <span class="male">male</span> and a <span class="female">female</span>.</p></body>
×
×
  • Create New...