Jump to content

jamesadrian

Members
  • Content Count

    61
  • Joined

  • Last visited

Everything posted by jamesadrian

  1. dsonesuk, Thank you for this link. I am using html 5 and my browser is Safari 11.1.2 which is higher than 10. The source code I am using is this: <a href="https://www.futurebeacon.com/00Music/JA2.mp3 download>Download Music <img src="https://www.futurebeacon.com/00Music/JA2.mp3"></a> It is on my front page. I does not work and "Download Music" does not get rendered for the visitor. Can you help me find out what is going wrong? Thank you for your help. Jim Adrian
  2. My website is here: https://futurebeacon.com On that front page source I have a code that looks like this: <a href="https://www.futurebeacon.com/00Music/JA2.mp3" class = link_style1>More Music by James Adrian</a> It sends the website visitor to this location: https://www.futurebeacon.com/00Music/JA2.mp3 The music in the file JA2.mp3 immediately begins playing. This is what I want it to do. I am trying to also allow the visitor to download the file from the page that plays the music and I have been searchings for instructions to do that in such a way that the file does not play music but downloads the file. All the instructions I have read would have me use the same code that I am currently using to play the music. I can't see a difference. Please tell me what I am missing. Thank you for your help. Jim Adrian
  3. I have a page that works here: https://www.futurebeacon.com/00Music/scoremakerdemo.htm I am looking for a way to continuously display in the menu at the top of the page the mouse position at all times except possible when a mouse button is being pressed. Google and Bing seem to give me only similar subjects - like the position when hovering over a specific thing. Any leads would be greatly appreciated. Thank you for your help. Jim Adrian jim@futurebeacon.com
  4. I have an html page containing javascipt that works. It allows the visitor to the website to drag a small square .png picture (a note) and place it anywhere on the background picture which is a musical staff: https://www.futurebeacon.com/00Music/stepstaff.htm I want to enhance it in such a way that when I drag the note from its original position a copy is made that stays at the original position. That way the visitor to the website can drag and place as many notes on the staff as desired and the placement locations would be independent of each other. Here is the source code: <!DOCTYPE html> <head> <title>Note Staff</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style> #mydiv { position: absolute; //z-index: 0; //background-color: #FFFFFF; //text-align: center; // border: 0px solid #FFFFFF; } #mydivheader { //padding: 0px; cursor: move; //z-index: 0; // background-color: #FFFFFF; // color: #000000; } </style> <style></style></head> <body style="background-image: url(https://www.futurebeacon.com/00Music/cstaffx.png);"> <div style="font-size: 10px; line-height: 10px;"> <div id="mydiv"> <div id="mydivheader"><img src="https://www.futurebeacon.com/00Music/note.png" width="17" border="1" /></div> </div> </div> <script type="text/javascript"> //Make the DIV element draggagle: dragElement(document.getElementById(("mydiv"))); function dragElement(elmnt) { var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0; if (document.getElementById(elmnt.id + "header")) { /* if present, the header is where you move the DIV from:*/ document.getElementById(elmnt.id + "header").onmousedown = dragMouseDown; } else { /* otherwise, move the DIV from anywhere inside the DIV:*/ elmnt.onmousedown = dragMouseDown; } function dragMouseDown(e) { document.onmouseup = closeDragElement; // call a function whenever the cursor moves: document.onmousemove = elementDrag; } function elementDrag(e) { // get mouse position e = e || window.event; // transform position to grid snapPosition = getSnapPos(e.clientX, e.clientY); // set the element's new position: elmnt.style.top = snapPosition.y + "px"; elmnt.style.left = snapPosition.x + "px"; } function getSnapPos(xPos, yPos) { snapX = 14; snapY = 10; newX = Math.round(xPos / snapX) * snapX; newY = Math.round(yPos / snapY) * snapY; return {x:newX, y:newY}; } function closeDragElement() { /* stop moving when mouse button is released:*/ document.onmouseup = null; document.onmousemove = null; } } </script> </body> </html> ------------------------------------------------------ I have no idea where to start investigating how this kind of thing is done. Does anybody here know what I should look into? Thank you for your help. Jim Adrian jim@futurebeacon.com
  5. I found typos and it now works. Thank you for all your help. Jim Adrian
  6. Ingolme, Thank you for this suggestion. It worked. I have a problem with the code: <!DOCTYPE html> <html> <head> <style> /* Dropdown Button */ <!-- Dropdown Button --> .dropbtn { background-color: #4CAF50; color: white; padding: 16px; font-size: 16px; border: none; cursor: pointer; } <!-- The container <div> - needed to position the dropdown content --> .dropdown { position: relative; display: inline-block; } <!-- Dropdown Content (Hidden by Default) --> .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } <!-- Links inside the dropdown --> .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; } <!-- Change color of dropdown links on hover --> .dropdown-content a: hover {background-color: #f1f1f1} <!-- Show the dropdown menu on hover --> .dropdown :hover .dropdown-content { display: block; } <!-- Change the background color of the dropdown button when the dropdown content is shown --> .dropdown: hover .dropbtn { background-color: #3e8e41; } </style> </head> <body style="background-image: url(https://www.futurebeacon.com/fb1.png);"> <div style="position: absolute; top: 120px; left: 300px; font-size: 40px; line-height: 30px; font-family: times new roman;"> <b>Page Name</b> </div> <br /><br /> <br /><br /> <br /><br /> <br /><br /> <br /><br /> <div class="dropdown"> <button class="dropbtn">Dropdown</button> <div class="dropdown-content"> <a href="https://www.futurebeacon.com/">Link 1</a> <a href="https://www.futurebeacon.org/">Link 2</a> <a href="https://www.futurebeacon.com/email.htm">Link 3</a> </div> </div> <br /><br /> <br /><br /> <br /><br /> </body> </html> I changed the comment indicators from /* and */ to <!-- and -->. I hope that does not matter. The links in the menu work, but the menu is not hidden before it is pulled down. Can you suggest anything? Thank you for your help. Jim Adrian
  7. Ingolme, Thank you for this reply. I copied the code from this site https://www.w3schools.com/howto/howto_css_dropdown.asp I put the CSS material between head and /head. I used the html code suggested by that page. The resultant html page had the CSS material printed out at the top of the page instead of being hidded and affecting the html code. Is there something I should place at the top of the CSS material to announce it or contain it? Thank you for your help. Jim Adrian
  8. Ingolme, Thank you for this reply. Can I place the CSS material between head and /head? This is an example to be placed between body and /body of of the html file: <div class="dropdown"> <button class="dropbtn">Dropdown</button> <div class="dropdown-content"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> </div> Would the CSS material go in between the style /style terms which I have between head and /head? Thank you for your help. Jim Adrian
  9. My web pages each avoid the use of a separate CSS file this way: <!DOCTYPE html> <html> <head> <style> a.link_style0:link {color: #000000; text-decoration: none;} a.link_style0:visited {color: #000000; text-decoration: none;} a.link_style0:hover {color: #00AA00; text-decoration: none;} a.link_style0:active {color: #000000; text-decoration: none;} a.link_style1:link {color: #000000;} a.link_style1:visited {color: #000000;} a.link_style1:hover {color: #00AA00;} a.link_style1:active {color: #000000;} </style> </head> So far, this method is only used for links such as this one: <a href="https://www.futurebeacon.com/" class = link_style0>FutureBeacon.com</a> I would like to have a pull-down menu on a web page, but all the examples I have found seem to depend on a separate CSS file with I would like to avoid. Is this possible? Thank you for your help. Jim Adrian
  10. Moderator, I want the program to take a byte from file A, and another from file B, and use an arithmetic or logical operation on the two bytes and place the result in file C. All three files would be offline, possibly in a folder on the desktop. The program would need to increment the byte address in all cases. I don't care what I would need to use as names of the files or what file types might be used, so long as any eight bits would work as a byte. I would not appreciate a severe limit on the size of these files. One megabyte might be acceptable. If I can't create a file with the script, I would e happy to create them before the script is run. If file C happens to contain only ASCII characters that can theoretically be displayed, I would hope there would be a way to display them or use file C as a text file after the fact (after the script has run). Secondarily, it would be nice if I could interleave a file or use one file to determine a permutation of another file. Thank you for your help. Jim Adrian
  11. I want the simplest way for users to use the program. I would like to email it to them and have it run without any other downloading or complications on their desktop. Can this be done? Jim Adrian
  12. The forum front page says that this subject has had no comments or views. Jim Adrian
  13. Are these two links on topic? http://www.html5rocks.com/en/tutorials/file/dndfiles/ https://www.nczonline.net/blog/2012/05/08/working-with-files-in-javascript-part-1/ Jim Adrian
  14. I want to write programs that other people can run on their desktop. Does anything prevent this? Thank you for your help. Jim Adrian
  15. I have copied the code given above into a text editor and gave it the name test.htm and when I have it on my desktop and click on it my browser renders it as a local file without going on line. This is great! I hope that I can make a few text files and have a script in test.htm manipulate data in the files on my desktop. Of course I will need to know much more javascript to do that. I am willing to learn it all if this goal can be done. Will any additional software be needed in order to do this? Thank you for your help. Jim Adrian
  16. Foxy Mod, Thank you for this answer. It is strange that I could not find the answer in the W3Schools java script tutorial. Jim Adrian
  17. I am about to put a full effort into learning javascript, but there are certain features I cannot live without. One of them isthe XOR operation. I have read some comments about it online and I have looked for it int eh W3Schoold tutorial. I understand that ^ is the operator, but I am confused about how it works. If I have two byte values A and B, will C be what I expect? A ^ B = C Thank you for your help. Jim Adrian
  18. I am just starting to learn some java script. I am looking for a way to write a script on my desktop (which I have done) and see it work on two files on my desktop. I have only seen java script work on my website. Thank you for your help. Jim Adrian
  19. dsonesuk, Thank you for this information. I will now start in on the tutorial. Jim Adrian
  20. dsonesuk, You included in your solution to the contact form problem a script that I assume is java script. I know nothing about it, but I am happily using it. I surely need to learn about it. Would you give me a brief description of what this particular scrip does? <script> window.onload = function() { var myForm = document.getElementById("myForm"); myForm.onsubmit = function() { for (i = 0; i < myForm.elements.length; i++) { var convert = ""; if (myForm.elements[i].type !== "submit" && myForm.elements[i].type !== "reset" && myForm.elements[i].type !== "hidden") { convert = myForm.elements[i].name.replace('Tmp', ''); var input = document.createElement("input"); input.setAttribute("type", "hidden"); input.setAttribute("name", convert); input.setAttribute("value", myForm.elements[i].value); myForm.appendChild(input); myForm.elements[i].value = ""; } } return true; }; }; </script> Thank you for your help. Jim Adrian
  21. dsonesuk, I don't know how I missed it all this time. http://www.needsnotmet.com/ looks better now. Thank you. Jim Adrian
  22. In the website php contact script and html form that we have been discussing, I find a problem that I have encountered before. I haven't found a remedy. In the last two lines of the form below there is a submit button and a send button. The text size for the word SEND and for Clear Form is something I would like larger, but I cannot find a way to control it from within the form. <form id="myForm" method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>"> Name<br /> <input type="text" name="NameTmp" value="" size="29" maxlength="75"> <br /> Email Address<br /> <input type="text" name="EmailTmp" value="" size="29" maxlength="75"> <br /><br /> Questions and Comments about Needs Not Met: <br /><br /> <textarea name="CommentsTmp" rows="12" cols="60"> </textarea> <br /><br /> This window will scroll for long messages. <br /><br /> <input type="submit" name="Submit" style="width:100px; height:100px;" value="SEND" /> <input type="reset" style="width:100px; height:100px;" value="Clear Form"> </form> I have tried many suggestions from several websites, but nothing works. Does anybody here know how to do it? It can bee seen at the top of http://www.needsnotmet.com. Thank you for your help. Jim Adrian
  23. dsonesuk, This is a very valuable script. Thank you. Jim Adrian
  24. Does anybody know how to prevent the back arrow from refilling the form? Thank you for your help. Jim Adrian
×
×
  • Create New...