Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:16

back quotes and style="prop:val"


Poster: MTD
Dated: Monday August 9 2004 - 21:07:19 BST

Hi,

I would like to have more information about what mean:
Code:
style="prop:val"
which seems to be absolutely needed
then where are using back quotes and HTML on a main menu.

I use often the menu to place objects (like floating search form) in the page. It took me a while to understand why it was not apearing, and I found out it was that part missing. I have to put it on the FORM tag or a DIV tag, but I don't understand what it does.


And by the way, do you think it could be possible to make the parser accept line feed when using back quotes? To accept everything until the closing back quote.


Thank you very much.

Re: back quotes and style="prop:val"


Poster: John
Dated: Monday August 9 2004 - 21:26:54 BST

MTD wrote:
I would like to have more information about what mean:
Code:
style="prop:val"
which seems to be absolutely needed
then where are using back quotes and HTML on a main menu.

Where exactly did you see that? I need to know the context to give a reasonable answer.
MTD wrote:
I use often the menu to place objects (like floating search form) in the page. It took me a while to understand why it was not apearing, and I found out it was that part missing. I have to put it on the FORM tag or a DIV tag, but I don't understand what it does.

type=form;, in addition to <form>...</form> - not div.


Poster: MTD
Dated: Monday August 9 2004 - 21:33:15 BST

In those exact 2 cases, if I remove the code, I don't see the menu.

Code:
with(milonic=new menuname("search")){
top=235;
screenposition="center"
left="offset=-220";
style=StyleSimple;
alwaysvisible = 1;
position="absolute";
aI("type=form;text=`<form style=\"prop:val;\"><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td colspan=\"2\"><img src=\"imgSite/TitreRech.gif\" width=\"209\" height=\"28\" alt=\"\" /></td></tr><tr><td valign=\"middle\" align=\"left\" style=\"padding-left:9px;padding-right:2px;\"><input type=\"text\" style=\"border: 1px solid #ACACAC; width: 172px; height: 18px;\" /></td><td valign=\"middle\" align=\"right\"><a href=\"\"><img src=\"imgSite/BtnGoRech.gif\" width=\"22\" height=\"22\" alt=\"GO\" border=\"0\" /></a></td></tr></table></form>`;");
}


and

Code:
with(milonic=new menuname("flash")){
top=298;
screenposition="center"
left="offset=-141";
style=StyleSimple;
alwaysvisible = 1;
position="absolute";
aI("text=`<div style=\"prop:val;\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"375\" height=\"22\" id=\"bande_laurendeau\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\"bande_laurendeau.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\"bande_laurendeau.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"375\" height=\"22\" name=\"bande_laurendeau\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object></div>`;");
}



But I did it with a very much simple line of HTML like:
Code:
<div>hello</div>

and It did not appeared until i did:
Code:
<div style=\"prop:val;\">hello</div>


For the flash example, it would not appear until I added a DIV tag.


Poster: MTD
Dated: Friday August 20 2004 - 23:12:26 BST

Still no clue?


Poster: John
Dated: Saturday August 21 2004 - 18:31:13 BST

It is not necessary to quote (or backquote) items in the aI statements. Therefore, no backslash, either.

Still would like to know what style=\"prop:val;\" is.


Poster: MTD
Dated: Saturday August 21 2004 - 18:39:58 BST

It comes for the howtobuild.txt manual with in the zip file we download.


Poster: John
Dated: Saturday August 21 2004 - 21:14:41 BST

That's just an example of how to code. There is no such thing as prop:value. Rather, Andy was just showing how to code an inline style if you decided to use one. An example would be...
Code:
style=border:1px solid #990033;

In this case, 'prop' (css property) is 'border', and value is '1px solid #990033'. Note you already have a proper style item included. Remove style=\"prop:val;\" from your aI.

Try this...
Code:
aI("type=form;text=<form><table cellspacing=0 cellpadding=0 border=0><tr><td colspan=2><img src=imgSite/TitreRech.gif width=209 height=28 alt= /></td></tr><tr><td valign=middle align=left style=padding-left:9px;padding-right:2px;><input type=text style=border: 1px solid #ACACAC; width: 172px; height: 18px; /></td><td valign=middle align=right><a href=#><img src=imgSite/BtnGoRech.gif width=22 height=22 alt=GO border=0 /></a></td></tr></table></form>;");


Poster: MTD
Dated: Saturday August 21 2004 - 22:02:05 BST

If I change this :

Code:
with(milonic=new menuname("flash")){
top=298;
screenposition="center"
left="offset=-141";
style=StyleSimple;
alwaysvisible = 1;
position="absolute";
aI("type=form;text=`<div style=prop:val;><object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 codebase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0 width=375 height=22 id=bande_laurendeau align=middle><param name=wmode value=transparent /><param name=allowScriptAccess value=sameDomain /><param name=movie value=/bande_laurendeau.swf /><param name=quality value=high /><param name=bgcolor value=#ffffff /><embed src=/bande_laurendeau.swf quality=high bgcolor=#ffffff width=375 height=22 name=bande_laurendeau align=middle allowScriptAccess=sameDomain type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer /></object></div>`;");
}


for this (removing "style=prop:val;") :

Code:
with(milonic=new menuname("flash")){
top=298;
screenposition="center"
left="offset=-141";
style=StyleSimple;
alwaysvisible = 1;
position="absolute";
aI("type=form;text=`<div><object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 codebase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0 width=375 height=22 id=bande_laurendeau align=middle><param name=wmode value=transparent /><param name=allowScriptAccess value=sameDomain /><param name=movie value=/bande_laurendeau.swf /><param name=quality value=high /><param name=bgcolor value=#ffffff /><embed src=/bande_laurendeau.swf quality=high bgcolor=#ffffff width=375 height=22 name=bande_laurendeau align=middle allowScriptAccess=sameDomain type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer /></object></div>`;");
}


then I get an undefined error in line 24 in the "milonic_src.js" file.

So style=\"prop:val;\" is mandatory or else it's not working.
If it's there in the sample and it causes an error, it must has something to do with the menu.

And if I don't do a DIV tag, the <Object> does not appear at all.

Maybe it's not the right way, but when the style is there it's working just fine. I would love to know why I put this code which I don't understand what it's for.

And also, you are forced to backquote when many symbols in the text can conflict with the parser. In this case exactly, in either way, it does not work without the backquotes.


Poster: John
Dated: Sunday August 22 2004 - 1:25:44 BST

What I posted had nothing to do with Flash (which I didn't see). It was just a plain form.

Speaking of which, why is your Flash item type=form?


Poster: MTD
Dated: Sunday August 22 2004 - 1:29:26 BST

I was just because I tried to see if it makes a change. type=form does not change the results of all the tests. I tried with and without it and have not seen any diffrence at all.


Poster: kevin3442
Dated: Sunday August 22 2004 - 7:28:36 BST

Hi MTD,

I'm going to have to disagree with your diagnosis.
MTD wrote:
...then I get an undefined error in line 24 in the "milonic_src.js" file. So style="prop:val;" is mandatory or else it's not working.

As John says, the following line from the howtobuild.txt file
Quote:
aI("text=`<form style="prop:val;"><input name=txt></form>`;");

Is meant as a sort of example template... the format you should follow, not the exact code to put in. Just as the following code from the same .txt file:
Quote:
with(milonic=new menuname("mainmenu")){
PARAMETERS. . . .
PARAMETERS. . . .
}

is meant as a format to follow, not actual code to use to define a menu.

There is nothing in the menu system that requires or even recognizes
Code:
style="prop:val;">
as part of the code used to build a menu item. It's simply the format you follow when applying a style (in the menu or in any otehr html).

MTD wrote:
If it's there in the sample and it causes an error, it must has something to do with the menu.

It's an unfortunate fact of javascript that the error codes and locations you get often have very little to do with the actual nature and location of the error. In this case, there's something else wrong in the menu code, but it has nothing to do with style=prop:val. I'm thinking that you might want to try not using the back quotes, remove the <div></div>, change all of the /> to >, and specify type=html in your aI() definition. I tried the following modification of the aI() code you posted, and it worked just fine (all on one line in your .js file, no line breaks):
Code:
aI("type=html;text=<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 codebase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0 width=375 height=22 id=bande_laurendeau align=middle><param name=wmode value=transparent><param name=allowScriptAccess value=sameDomain><param name=movie value=bande_laurendeau.swf><param name=quality value=high><param name=bgcolor value=#ffffff><embed src=bande_laurendeau.swf quality=high bgcolor=#ffffff width=375 height=22 name=bande_laurendeau align=middle allowScriptAccess=sameDomain type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer></object>;");


Give that a shot and see if it works for you. Come on back if it doesn't and we'll figure it out.

Cheers,

Kevin