Jump to content

aaronjones3593

Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by aaronjones3593

  1. No.That is really not what I want.Take it I want to have a popup field with explaining text about the hovered element when hovering it :)Exactly when someone hoveres an IMG with a certain ALT specified. The person would get a tooltip there too, wouldn't he :)The popup would be just like another layer on the document, cascading everything that is behind it, not caring about characters that would be cut-off. Like a tooltip which is the text specified in ALT by an IMG, the popup would disappear when you click in the window or the tooltip.As I said before, and I shall say it again: the window.open() is not able to do that. You can't open a window that closes itself when the other window is clicked. Popups do :(

    you CAN close a popup window from another window when it is clicked using the following:
    function doPopup(){windowOne = window.open("somepage.htm", "windowOne", define_dimensions_and_sizes_here, "_blank");openedPopup = true;}windowOne = "";openedPopup = false;

    Then:

    In Main window:<body onfocus="if(openedPopup){windowOne.window.close();}">In popup window:<body onclick="self.opener.openedPopup=false; window.close();">

    With the object:

    <input type="button" value="Testing" onmouseover="doPopup()">Or<input type="button" value="Testing" onclick="doPopup()">

  2. Going back to a point that was brought up a while back...isn't the whole idea of w3schools to promote cross-browser coding methods....? Why pick a "solution" to your problem that relies on a method that not everyone will be able to take advantage of?  I can't see any good reason why you wouldn't wish to invest your time looking into a floating DIV which would provide much better access to your page, and increase your knowledge of coding.For someone who prefers sticking to strict XHTML rules, it seems, why not try something w3c valid?

    He could try this, I found it on a open source website (i think it was dhtmlcentral) where you mouseover an object and it displays a moving floating div, that moves with the mouse. u can download the source code js file from the website belowDHTML Centralthen click download sourcecode and imagesIt does say it only works for links, but you can use it for anything that supports the onMouseover event, which means it should be cross-browser.
  3. I made a form using html and saved it as a page itself.What it does is have the user type in their comments about the site, however I need to know how to save the data they enter then the data they entered is emailed to me. IF ANYONE HAS ANSWERS PLEASE PLEASE RESPOND!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I CAN BE EMAILED AT: crazy34502001@yahoo.com

    Add the mailto:your_email_address bit into the form tag.
    <form action="mailto:crazy34502001@yahoo.com"><!-- Form Items Here --><input type="submit" value="Send"></form>

    The data will be in RAW format, like so:Text field called textfield1 and textarea called textarea1, both fields contain the words "test email" without the quotes. When the user submits the form, you get sent an email containing the following:textfield1=test+email&textarea1=test+emailSpaces are "+" and seperate fields are "&" and field names are before the "=" and values are after the "=". Only way to do it without server-side scripts.

  4. Yup. Unless you had a variable called abc.

    eval() is a function to evaluate a piece of javascript code, like so:
    eval("alert('Hello')");

    Notice two things:1: The code must be inside quotes ( "" )2: The code inside the quotes cannot end with a semi-colon ( ; ), which means you can only evaluate 1 line of code at a time.I had to use eval() when I made my own game... :):)

  5. Try this: :)

    <html><head><title>Blah blah</title><script language="JavaScript">function resetAllItems(){ for (i = 0; i < itemIds.length; i++) {  document.getElementById(itemIds[i]).style.display = "none"; }}function expandItem(itemId){ resetAllItems(); document.getElementById(itemId).style.display = "";}var itemIds = new Array();itemIds[0] = "divSearchForm";itemIds[1] = "divOtherThing";itemIds[2] = "divLastDropDw";</script></head><body bgcolor="#FFFF00" link="#FFFFFF" alink="#FFFFFF" vlink="#FFFFFF"><!-- Navigation Menu Start --><div id="divMainMenu" style="background-color:green;"><a href="JavaScript:expandItem(itemIds[0]);">Search</a> -<a href="JavaScript:expandItem(itemIds[1]);">Other thing</a> -<a href="JavaScript:expandItem(itemIds[2]);">Last thing</a> -<a href="JavaScript:resetAllItems();">Collapse all</a></div><!-- Navigation Menu End --><p> </p><div id="divSearchForm" style="display:none;">Your search form here</div><div id="divOtherThing" style="display:none;">Some other thing here</div><div id="divLastDropDw" style="display:none;">I dunno, getting bored now</div></body></html>

    Dont forget to populate all "subitems" in the array itemIds.Tried and tested, don't know if it is cross-browser compatible, works in IE 4.0+Hope this helps, don't know if it is what you were looking for. :)Email me for the file I saved it as when I was testing it.

  6. Hmm, you got me stuck there.Try this:

    var something = "64.83657639"; // Number you want to format, must be in quotesvar decimalPos = something.indexOf(".");var otherthing = something.substring(0,decimalPos + 3);var decimalPlc = parseInt(something.charAt(decimalPos + 3));if (decimalPlc > 5){ otherthing = parseFloat(something.substring(0,decimalPos + 3)) + 0.01;}var finalOutpt = "£ " + otherthing;

    EDITED FOR SUPPORT OF NUMBERS GREATER THAN 9.99Where finalOutpt would be the variable containing the formatted version of the number.The number you want to format must be enclosed in quotes (Must be treated as string) otherwise you would get a object does not support this method error.Hope that helps, I did test it and it does work, but don't know whether it was what you were looking for.

  7. No bradley.lee, you haven't read my explanation.window.open() is not what I want, window.createPopup() is.

    Only way i can think of is something like bradly.lee's approach.
    var someWindow = window.open("somepage.htm", "_blank");someWindow.document.writeln("Hello"); // Would write "Hello" into the POPUP windowsomeWindow.alert("Hello"); // Would create an alert box in the POPUP window

    I know this works before because I have used it in my JavaScript Login and Admin Management Software...

  8. Set the onUnload event into the body tag to open the page when the event triggers.somepage.htm :

    <html><head><title>Blah blah</title></head><body onUnload="if (document.getElementById('someTextarea').value=='')window.open('somepage.htm', '_blank');"><textarea id="someTextarea"></textarea></body></html>

    or if you dont like to use inline java script:

    <html><head><title>Blah blah</title><script language="JavaScript">function checkIfNothing(){ if (document.getElementById("someTextarea").value == "") {  window.open("somepage.htm", "_blank"); }}</script></head><body onUnload="checkIfNothing();"><textarea id="someTextarea"></textarea></body></html>

    Be warned ! the onUnload event also fires when the page is refreshed.

×
×
  • Create New...