Can you add the current date into a menu?
Can you add the current date into a menu?
I'm wondering if there is an easy way to incorporate a current date into the menu.
For reference, my draft menu is at: http://www.dracoblu.com/testindex.html
I wish to place a current date in the horizontal menu aligned to the far right.
If anyone has suggestions it would be greatly appreciated.
Thanks, Pat
For reference, my draft menu is at: http://www.dracoblu.com/testindex.html
I wish to place a current date in the horizontal menu aligned to the far right.
If anyone has suggestions it would be greatly appreciated.
Thanks, Pat
Hi,
You can use the menuclock.js module and set up a current date and time. I will check to see if it's possible to get it to only set the date and post back when I find out. You can find a demo of it under the demos, it will be the 2nd one under the bolt-on module demos at the bottom. Make sure you download the newest menuclock.js file. There is a link for it at the bottom of the clock demo page.
http://support.milonic.com/demos/
One thing to note, since you are putting the menu into a div, there's really no way to get the date to be aligned to the right unless you change the layout to have two separate menus in their own divs or put a two column table into that div and put the clock data file into the right had column. For example:
Your clock_main.js would be
And you would need to add the menuclock.js module call like this before you menu_data file
Hope this helps.
Ruth
You can use the menuclock.js module and set up a current date and time. I will check to see if it's possible to get it to only set the date and post back when I find out. You can find a demo of it under the demos, it will be the 2nd one under the bolt-on module demos at the bottom. Make sure you download the newest menuclock.js file. There is a link for it at the bottom of the clock demo page.
http://support.milonic.com/demos/
One thing to note, since you are putting the menu into a div, there's really no way to get the date to be aligned to the right unless you change the layout to have two separate menus in their own divs or put a two column table into that div and put the clock data file into the right had column. For example:
Code: Select all
<DIV class=topnav id=nav><table width="100%"; cellpadding=0 cellspacing=0 border=0>
<tr>
<td><SCRIPT language=javascript src="embed_main.js"
type=text/javascript></SCRIPT></td>
<td><SCRIPT language=javascript src="clock_main.js"
type=text/javascript></SCRIPT></td>
</tr>
</table>
</DIV>
Code: Select all
with(milonic=new menuname("clock")){
style=style1;
alwaysvisible=1;
orientation="horizontal";
position="relative";
aI("valign=top;text="+getMilonicDate()+";align=right;type=clock;offbgcolor=#000000;onbgcolor=#000000;offcolor=#ffffff;oncolor=#ffffff;");
}
drawMenus();
Code: Select all
<SCRIPT language=Javascript src="menuclock.js" type=text/javascript></SCRIPT>
<SCRIPT language=javascript src="bonesingermenu_data.js"
type=text/javascript></SCRIPT>
Ruth
Hi,
Normally I would not do modifications since in most cases I wouldn't know how. But, since I figured this one out and Andy said it was OK you can get date only like this.
Download the menuclock.js file and open it in a text editor. Find this line
And change it to this
And now you have only the date.
Ruth
Normally I would not do modifications since in most cases I wouldn't know how. But, since I figured this one out and Andy said it was OK you can get date only like this.
Download the menuclock.js file and open it in a text editor. Find this line
Code: Select all
return dayNames[_dayNum]+" "+_day+getNumberSuffix(_day)+" " + monthNames[_month] + " " + _year + "<BR><b>" + _time+"</b>"
Code: Select all
return dayNames[_dayNum]+" "+_day+getNumberSuffix(_day)+" " + monthNames[_month] + " " + _year + " "
Ruth
Thanks Ruth. I have incorporate the code into the menu at: http://www.dracoblu.com/testindex.html
A couple of problems I have noticed....The date appears as a hyperlink with an error of: javascript:void(0) in both FF and IE. I also notice that in IE the horizontal menu bar is double with width than it is in FF. I am not sure why...if you have any suggestions that would be great.
Thanks, Pat.
A couple of problems I have noticed....The date appears as a hyperlink with an error of: javascript:void(0) in both FF and IE. I also notice that in IE the horizontal menu bar is double with width than it is in FF. I am not sure why...if you have any suggestions that would be great.
Thanks, Pat.
Hi,
It's something built in about the form. It's as if the form automatically puts a br after the form close tag, I think it's some kind of margin because setting margin in the aI fixes it.
That seems to eliminate that extra space.
Ruth
It's something built in about the form. It's as if the form automatically puts a br after the form close tag, I think it's some kind of margin because setting margin in the aI fixes it.
Code: Select all
aI("text=`<form><input><input> <input></form>`;type=form;");
Ruth
Interesting, the code buttons don't seem to be working right.
Ok I'm changing your < brackets to [ so I can post the code. Don't forget to change them back to <and>
I'm not sure what's going on I'll have to post to Andy.
Ruth
Ok I'm changing your < brackets to [ so I can post the code. Don't forget to change them back to <and>
Code: Select all
aI("text=`[form style='margin:0px;' method=get action=http://search.atomz.com/search/]
Ruth
Hi,
Here's how to get rid of the extra space:
Here's a fix for the error, you had 2 hashes for the oncolor:
Not much we can do about the javascript:viod problem because the link is being echoed to the status bar to indicate where the link supposed to be linking to, it's a security thing.
-- Andy
Here's how to get rid of the extra space:
Code: Select all
aI("text=`<form><input> <input> <input></form>`;type=form;");
Code: Select all
aI("valign=top;text="+getMilonicDate()+";align=right;type=clock;offbgcolor=#003366;onbgcolor=#003366;offcolor=#ffffff;oncolor=#ffffff;");
-- Andy
Thanks Andy.... I did not see your reply right away, so it has been a few days.
I removed the extra hash mark in the clock_main.js, and inserted the no break space a few different ways in the embed_main.js file, but I cannot seem to remove the extra horizontal space in IE. Here is the current code I have associated with http://www.dracoblu.com/testindex.html
aI("text=`<form method=get action=http://search.atomz.com/search/> <input type=submit value=Search style='color: #010425; font-family: arial; font-size: 11px' /> <input type=hidden name=sp-a id=sp-a value=sp10015b5a /> <input type=text size=20 name=sp-q id=sp-q style='color: #010425; background-color: #eeeeee; font-family: arial; font-size: 11px' /></form>`;type=form;");
}
Any help would be appreciated. Thanks, Pat.
I removed the extra hash mark in the clock_main.js, and inserted the no break space a few different ways in the embed_main.js file, but I cannot seem to remove the extra horizontal space in IE. Here is the current code I have associated with http://www.dracoblu.com/testindex.html
aI("text=`<form method=get action=http://search.atomz.com/search/> <input type=submit value=Search style='color: #010425; font-family: arial; font-size: 11px' /> <input type=hidden name=sp-a id=sp-a value=sp10015b5a /> <input type=text size=20 name=sp-q id=sp-q style='color: #010425; background-color: #eeeeee; font-family: arial; font-size: 11px' /></form>`;type=form;");
}
Any help would be appreciated. Thanks, Pat.
Thanks John... I have not played with IE7, so if you have any suggestions that would be great. It is still in beta, right?...Maybe that will make a difference.
This is a bit off topic, I will be trying to make this a CSS compliant website. Do you have a CSS alternative to a table for this part of the code calling the menu and clock?
<div class="topnav" id="nav"><table width="100%"; cellpadding=0 cellspacing=0 border=0>
<tr>
<td><SCRIPT language=javascript src="embed_main.js"
type=text/javascript></SCRIPT></td>
<td><SCRIPT language=javascript src="clock_main.js"
type=text/javascript></SCRIPT></td>
</tr>
</table>
</div>
Thanks again.
This is a bit off topic, I will be trying to make this a CSS compliant website. Do you have a CSS alternative to a table for this part of the code calling the menu and clock?
<div class="topnav" id="nav"><table width="100%"; cellpadding=0 cellspacing=0 border=0>
<tr>
<td><SCRIPT language=javascript src="embed_main.js"
type=text/javascript></SCRIPT></td>
<td><SCRIPT language=javascript src="clock_main.js"
type=text/javascript></SCRIPT></td>
</tr>
</table>
</div>
Thanks again.
Hi,
I don't know what you mean by something different than the table. If you correct the errors the page will validate.
I don't do xhtml but I did get it to validate after fiddling until I could figure out what the errors were. that shorttag=yes I finally found was that you had to put quotes around things like class=topnav, cellpadding=0, type=text/javascript. I believe you can remove the language=javascript from the calls for the two files that were causing problems It seems to still work, but I don't have all browsers to check it.
Ruth
I don't know what you mean by something different than the table. If you correct the errors the page will validate.
I don't do xhtml but I did get it to validate after fiddling until I could figure out what the errors were. that shorttag=yes I finally found was that you had to put quotes around things like class=topnav, cellpadding=0, type=text/javascript. I believe you can remove the language=javascript from the calls for the two files that were causing problems
Code: Select all
<script src="embed_main.js" type='text/javascript'></script>
Ruth
Thanks for the reply, Ruth.
I have played with removal of the language=javascript command, but that does not change the display of the menu search in a two line block in IE7. FF displays properly.
The current draft can be viewed at:
http://www.dracoblu.com/testindex1.html
I have played with removal of the language=javascript command, but that does not change the display of the menu search in a two line block in IE7. FF displays properly.
The current draft can be viewed at:
http://www.dracoblu.com/testindex1.html
Hi,
My response was to the validation.
You did not include the style and margin: 0px in the form which was how I got rid of the extra space.
EDIT: Link Removed
Ruth
My response was to the validation.
You did not include the style and margin: 0px in the form which was how I got rid of the extra space.
EDIT: Link Removed
Ruth
Last edited by Ruth on Thu Nov 30, 2006 6:44 am, edited 1 time in total.
Thanks Ruth. I got the files, and inserted the style for the form. It works!
I have not eliminated the idea of a date in the menu. I am trying to avoid a table to call the clock_main.js or another similar JS file that I have on hand called date.js ...The CSS is not co-operating and placing the info behind the menu.
Thanks again for you help. I really appreciate it.
I have not eliminated the idea of a date in the menu. I am trying to avoid a table to call the clock_main.js or another similar JS file that I have on hand called date.js ...The CSS is not co-operating and placing the info behind the menu.
Thanks again for you help. I really appreciate it.
Hi,
Well, I really don't do any real css since there is no place that gives you explanations that are easy to understand and visuals to see what's happening when you change things so you can see how they work, absolute, relative, fixed static and so on and so on and oh if borders meet then this happens and that happens. Sorry that the table is the only way I know to do it that I can position correctly. When they create something that makes sense as to divs and positioning them I'll do more css
However, for those who know css, divs and positioning, I'd think one should be able to place two divs side by side one for the menu one for the date right where you have the one div now into which I put the 'oh so easy to configure and put where you want it so it will stay there' table.
Ruth
Well, I really don't do any real css since there is no place that gives you explanations that are easy to understand and visuals to see what's happening when you change things so you can see how they work, absolute, relative, fixed static and so on and so on and oh if borders meet then this happens and that happens. Sorry that the table is the only way I know to do it that I can position correctly. When they create something that makes sense as to divs and positioning them I'll do more css
However, for those who know css, divs and positioning, I'd think one should be able to place two divs side by side one for the menu one for the date right where you have the one div now into which I put the 'oh so easy to configure and put where you want it so it will stay there' table.
Ruth
Re: Can you add the current date into a menu?
Hi ruth,
I have a question concerning menuclock.js... What is the right place for the
when I'm using the php-version of milonic because there is no
Is this the right way to call the clock after placing the scipt-code in the right way?
Thanks in advance...
wuscheck
I have a question concerning menuclock.js... What is the right place for the
Code: Select all
<SCRIPT language=Javascript src="menuclock.js" type=text/javascript></SCRIPT>
Code: Select all
<SCRIPT language=Javascript src="menu_data.js" type=text/javascript></SCRIPT>
Code: Select all
$mmMenu->addItemFromText("text=`+getMilonicDate()+`;align=center;type=clock;");
wuscheck