Results 1 to 6 of 6

Thread: greeting according to time

  1. #1
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default greeting according to time

    Hey,
    I saw on a site a greeting (good morning); that changes at noon into 'good day', and at two in 'good afternoon', etc.
    Anyone has that script ?

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    You can use the following code

    Code:
    	tme = new Date();
    	hrstme = tme.getHours();
    	var timemsg;
    	
    	if (hrstme < 7){
    		timemsg = "Good morning, you are very early! "
    	}else if (hrstme > 6 && hrstme <12){
    		timemsg = "Good morning! "
    	}else if (hrstme > 11 && hrstme <18){
    		timemsg = "Good afternoon! "
    	}else if (hrstme >17 && hrstme < 23){
    		timemsg = "Good night! "
    	}
    	document.write(timemsg)}

  3. #3
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    Now the tricky thing:
    I'd like to place this in the hover text " Good--, welcome to the officia ..." on http://www.cecicasariego.com
    (move over the flags).
    How can this be done, please ?

  4. #4
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    In the normal case the title attribute of <a> will give you some tooltip kind of items as default in IE and FF (not sure about other browsers).

    In your case there is a function (JS) being called while hovering the mouse over the flags. If you remove those functions the tooltip will be displayed. Or we need to check a more specific tooltip script (JS) that suits your purpose.

    If you can remove the 'onmouseover' event from the below mentioned <a> tags then the tooltip will appear. If it is not possible then plz let me know about it. Following tags doesn't have a onmouseover as I've removed them to show that.
    Code:
    <a title="Welcome to officia..." href="http://www.cecicasariego.com/indexGB.html"><img src="Welcome%20to%20the%20official%20website%20of%20Ceci%20Casariego%20Mazereel_files/vlagEN.gif" style="border: 0pt none ;"></a>
    				<a href="http://www.cecicasariego.com/indexNL.html" title="Welcome to officia..."><img src="Welcome%20to%20the%20official%20website%20of%20Ceci%20Casariego%20Mazereel_files/vlagNL.gif" style="border: 0pt none ;"></a>

  5. #5
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    If you can remove the 'onmouseover' event from the below mentioned <a> tags then the tooltip will appear.
    I'd like to leave the onmouseover as it is now, but adding the greeting in the appearing text.

  6. #6
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    The following is a good tooltip application developed in JavaScript, which i think simple to customize for your purpose.

    http://www.dustindiaz.com/sweet-titles/

    sometimes you have to adjust the onmouseover event in a manner that it does your job as well as the tooltip show.

    Edited

    http://www.dynamicdrive.com/dynamici...tmltooltip.htm - another one from DD

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •