Recent Questions Struts Tree Example
Q: I am testing it on my website.
I have under the submenu 'Generalites" two links "Presentation" and "Formulaires"
I would like when I click on what ever link on the expandable javascript menu that the visited link stay in a different color and with a different background.
For exemple:
If I click on link Presentation then this link will become in a different color and also its background.
Then If I click on Formulaire the prevous link is reset and the Formulaire link appears in a differemt color and its backgroud. How should I do it ?
A: Javascript/DHTML Tree doesn't save a pressed
item as it saves a tree state. It works within 1 page only and if youreload the page you should set a pressed item using Javascript API:
function dtreet_ext_setPressedItem (menuInd, itemID)
Please, see here:
http://deluxe-tree.com/functions-info.html
You can also set
var tsaveState = 1;
More info you can find
http://deluxe-tree.com/data-samples/tree-menuxp-save-state.htm
To expand specific items you should use API function
function dtreet_ext_expandItem (itemID, expand)
Q: The menu has a problem with newlines. The menu builds correctly (layout ok) but when pressed on the button nothing happens
At some point, in the DHTML menu, we have the following in the javascript:
var menuitems = [
["|Print HTML","javascript:alert('HTML print: Only the 7 most recent orders on the screen \n will be printed because of space limitations on paper.');printResult('4'); ","","", ,"_parent",,] ]
As you can see we have a newline (\n) between the words "screen" and "will". But when we click on the button nothing happens. If we remove the newline and we click on the button then we first get the alert box. After pressing the OK button the function printResult is called.
Is there any way for us to still use the newline character in the menuItems variable?
This can be easily reproducible. That's why I haven't made an example.
A: Try to write in the following way \\n:
["|Print HTML","javascript:alert('HTML print: Only the 7 most recent orders on the screen \\n will be printed because of space limitations on paper.');printResult('4'); ","","", ,"_parent",,]
Q: I am using the deluxe menu in a cross frame set-up. The sub menu's are to be in the 'MAIN' frame. All works great until I have a php file loaded into the MAIN frame.. the sub menus will load in the parent frame.. where the main drop down menu is..
Click skip intro or wait for the site to appear… you will see the menu down the left side… if you click the second button down you will load a php blog page into the MAIN frame… then hover over the third button down and you will see the problem with the sub menu.. it works fine when other pages are loaded (click Home and then hover over the screenplay button again.
Everything is local (the blog is loaded and running for our server account)
A: Your menu is situated in http://www.domain.com domain andthis content is situated in http://domain.com domain(without www).
Try to use the same domains for the menu and your content.
Q: I set a custom target at '_mainFrame' required by Dreamweaver to view in a particular frame. When I click my button it opens in its own window.
Your thoughts would be appreciated.
A: Please, check the following code, for example
var itemTarget="_mainFrame";
["Galerie de photos","photos/index.php", "img/arrow_r.gif","img/arrow_o.gif", , "_self", , , , ],
or
["Galerie de photos","photos/index.php", "img/arrow_r.gif","img/arrow_o.gif", , "_mainFrame", , , , ],
I suppose that now you have such code
["Galerie de photos","photos/index.php", "img/arrow_r.gif","img/arrow_o.gif", , "_blank", , , , ],