Recent Questions Membuat Trees Down Menu Dengan Javascript
Q: The dhtml floating menu does not align to the top of the column and it migrates as one scrolls up or down the page. I would like it to stay in one place.
A: 1) Add valign="top"> parameter for the TD tag with the menu:
<td valign="top">
<script type="text/javascript" src="welcome_files/frenchdata.js"></script>
2) Open your frenchdata.js file in any text editor (or Deluxe Tuner) and change:
var absolutePos=0;
var posX="20px";
var posY="120px";
to
var absolutePos=0;
var posX="0px";
var posY="0px";
3) To turn off the floating feature you should set the following parameter in yourfrenchdata.js file:
var floatable=0;
Q: Is it possible to make the javascript menu buttons and the text bigger? Or at least the text larger?
Right now the text is so small that they actually look a little blurry.
The only font I can increase is the font on the dropdown menus. but I cant change the font that appear on the actual tabs. If I could increase the font on them that would be great.
A: You should change font in Individual styles.
var itemStyles = [
["itemWidth=92px","itemHeight=21px","itemBackImage=http://www.pursepage.com/wp-content/themes/pinkdoubleheader/data.files/btn_magentablack.gif,http://www.pursepage.com/wp-content/themes/pinkdoubleheader/data.files/btn_magenta.gif","itemBorderWidth=0", "fontStyle='normal 14px Arial','normal 14px Arial'","fontColor=#FFFFFF,#FFFFFF"],
];
Q: Sorry to bother you again, but we've done everything suggested in your fix regarding flash obscuring the multiple drop down menu, but we're still having the same problem in Firefox.
We've - set the parameter in the data file to - var dmObjectsCheck=1;
We've added the following to the start of the data file -
function dm_ext_ruleObjectHide()
{
return false;
}
We've embeded the flash as suggested to -
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
height="150" width="732" name="if-header">
<param name="movie" value="images/flash/if-header.swf">
<param name="quality" value="best">
<param name="play" value="true">
<param name="wmode" value="opaque">
<embed height="150" name="if-header"
pluginspage="http://www.macromedia.com/go/getflashplayer"
src="images/flash/if-header.swf"
type="application/x-shockwave-flash" width="732" quality="best"
wmode="opaque" play="true">
</object>
But still our multiple drop down menu sits behind the flash. Are we missing something else?
A: See it is necessary to have opaque parameters in <object> and <embed>tags to display submenus correctly in Firefox.
So, you should open .js file for your flash and find "embed" and"object" words.
And add opaque parameters, for example:
swfNode = '<embed type="application/x-shockwave-flash" wmode="opaque" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"';
swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
var params = this.getParams();
for( var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
var pairs = this.getVariablePairs().join("&");
if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
swfNode += '/>';
} else { // PC IE
if (this.getAttribute("doExpressInstall")) {
this.addVariable("MMplayerType", "ActiveX");
this.setAttribute('swf', this.xiSWFPath);
}
swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') + '">';
swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" /> <param name="wmode" value="opaque"> ';
var params = this.getParams();
for( var key in params) {
swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
}
Q: What can I do to optimize the load time for dhtml rollover
and prevent reloading it from the server with every page reload.
A: You can try to use AJAX technology.
AJAX-like technology: data for submenus can be loaded "on-the-fly" from the server.
New parameter:
var tajax = 0/1; - disables/enables AJAX-like support
Current syntax for item parameters ( var tmenuItems):
[text, link, iconNormal, iconOver, iconExpanded, tip, target, itemStyleInd, itemXPStyleInd, jsFileName]
Where jsFileName - .js filename on the server with submenu items ( var tmenuItems).