Jump to content

aspnetguy

Members
  • Posts

    6,787
  • Joined

  • Last visited

Everything posted by aspnetguy

  1. aspnetguy

    Web address

    By looks of things you are not ready to create a disscussion board...plus you cannot do it with only HTML anyways...You should go back and study the tutorials more.
  2. no problem it was really fun to work on
  3. this code tells you if a collision has occured in an alert box...this should get you started on your question <html><head><title>JavaScript key press event</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><script type="text/javascript">document.onkeydown = KeyCheck; function KeyCheck(e){var KeyID = (window.event) ? event.keyCode : e.keyCode;switch(KeyID){case 37:moveImg(0,-10);break;case 38:moveImg(-10,0);break;case 39:moveImg(0,10);break;case 40:moveImg(10,0);break;}}function moveImg(top,left){ var img = document.getElementById('img1'); var t = img.style.top; var t_val = parseInt(t.substring(0,t.length-2)); var l = img.style.left; var l_val = parseInt(l.substring(0,l.length-2)); if(collision(top,left,t_val,l_val)) { alert('collision'); //or do some other code } else { img.style.top = (t_val + top) + 'px'; img.style.left = (l_val + left) + 'px'; }}function collision(top,lft,topNow,lftNow){ if((topNow+top)==300 && (lftNow+lft)==300) return true; else return false;}</script></head><body><form><img id="img1" src="lotad.gif" style="position:absolute;top:100px;left:100px;width:10px;height:10px" alt=""/><img id="img1" src="lotad2.gif" style="position:absolute;top:300px;left:300px;width:10px;height:10px" alt=""/></form></body></html> In the collision() I used 300 as a static postion for the 2nd image on the screen...if they were both able to move then you would need to chanmge 300 to the current top and left of the 2nd image.
  4. Doesn't seem to be a problem...I scrolled the text and could still select from the naviagtion menu...I used IE6...but I have SP2 which made some updates to IE...maybe that is why it works for me.
  5. LOL...although it is usaully not the noobs you have to worry about stealing your stuff.
  6. aspnetguy

    Frames

    this is a basic layout for frames <FRAMESET cols="20%, 80%"> <FRAME src="contents_of_frame1.html"> <FRAME src="contents_of_frame2.gif"> <FRAME src="contents_of_frame3.html"> <NOFRAMES> <P>This frameset document contains: <UL> <LI><A href="contents_of_frame1.html">Some neat contents</A> <LI><IMG src="contents_of_frame2.gif" alt="A neat image"> <LI><A href="contents_of_frame3.html">Some other neat contents</A> </UL> </NOFRAMES></FRAMESET>
  7. just be careful when using absolute postion...it may render slightly different in different browsers...you can fix this with CSS hacks...just ask if you need to know how.
  8. In your User Profile you can edit your member title after you have made 500 posts (i think it is 500) I just noticed I could change it a couple days ago :)King of Vegas is a show I like a lot on Spike.
  9. glad to hear you figured it out.
  10. aspnetguy

    event handler

    glad I could help
  11. remove the % signs they are the syntax error
  12. it is a simple changechange document.onkeyup = KeyCheck; to document.onkeydown = KeyCheck;
  13. this should helphttp://www.thesitewizard.com/archive/rollovers.shtml.
  14. window.open(''page.htm,'pagename', should be window.open('page.htm','pagename', The (') are supposed enclose the page location
  15. inserting HTML, HEAD, aND BODY tags into a DIV is ncorrect syntax anyways....also your last line of code is wrong you use = infow when the variable name in info..Please post the ENTIRE page, knowing every piece of code is important.
  16. The suggestion I would make is use server side scripting when ever possible, like Eric said, client side can fall apart depending on the users browser.
  17. You may not be a master at 3 or 4 but you need to know a little of each. For exaple if you are a web designer/developer you have to understand database admin for your programs...you may not know everything there is but you need a little.I have been a web designer for 6 years now [(X)HTML,CSS,JS], a developer[web,desktop] for nearly 4 years [VB,C#,JAVA,.Net,PERL,] and am learning PHP and C/C++, I have also been playing with databases for 4 years
  18. quoted from www.tizag.comhmmmm....learn something new everyday.In college they drilled it into us to use semicolons, I never stopped to wonder if they were required or not...lolI use C# a lot, which does require them, so it is mostly a force of habit.
  19. As far as I know image map coordinates are static so if you your content shifts the image map is still looking at the same place...Perhaps you can modify the coordinates on mouseover with javascript...but I have no idea were to start.
  20. Those samples I gave were just that...samples they can;t just be cut and pasted together to make it work.Here is the solution <html><head> <title>JavaScript key press event</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><script type="text/javascript"> document.onkeyup = KeyCheck; function KeyCheck(e) { var KeyID = (window.event) ? event.keyCode : e.keyCode; switch(KeyID) { case 37: moveImg(0,-10); break; case 38: moveImg(-10,0); break; case 39: moveImg(0,10); break; case 40: moveImg(10,0); break; } } function moveImg(top,left) { var img = document.getElementById('img1'); var t = img.style.top; var t_val = parseInt(t.substring(0,t.length-2)); img.style.top = (t_val + top) + 'px'; var l = img.style.left; var l_val = parseInt(l.substring(0,l.length-2)); img.style.left = (l_val + left) + 'px'; }</script></head><body><form><img id="img1" src="lotad.gif" style="position:absolute;top:100px;left:100px" alt=""/></form></body></html>
  21. yes...ids must be unique!take your pick if they both work although be sure to check them in FireFox too...FF prefers getElementById().
  22. try referenceing them like this document.getElementById('arrayPet[0]').disabled = false; you will have to change the input boxes like this to add an id attribute <input type="text" name="arrayPet[0]" id="arrayPet[0]"/>
  23. no you replace # with a number....10px
  24. this will tell you all the features of a window you can controlhttp://www.javascripter.net/faq/openinga.htm
  25. You can only do that on windows your script have opened. You cannot do this on the main window
×
×
  • Create New...