How to Make TLN display Vertically
Dear All,
I have a requirement for displaying the TLN vertically instead of Horizontal display can any one help me on the same.
Thanks
Hi,
I have createded a custom TLN and that will also solve your problem.
I have doucmented in the below link Development of Custom Top Level Navigation -- Horizontal Drop-Down Menu (http://scn.sap.com/docs/DOC-56038) .
Regards,
Srinivas
Similar Messages
-
I have version 4, just downloaded, and a Mac w. OS 10.6. 7.
The bookmarks display (when I pull down "bookmarks") is much too wide. I can't figure out how to reduce the display size. The window is not persistent so I can't even get you a screen shot.
Thanks, SaraIt seems there was a change in Firefox 4 where the width of the drop-down is now determined by the length the longest bookmark name in the folder being displayed. Previous versions of Firefox would shorten a long name like that and add an ellipsis to signify the name was truncated.
Sorry, I don't know how to change that other than to advise you to edit the name of that long bookmark name and make it less verbose. Just scroll down the list of bookmarks in that wide folder until you see the culprit, then right-click that bookmark and open Properties & edit the Name line at the top of that dialog. -
How to make my display be the main view with my mac Book Pro
How to set up my external display automatically work as the main display when plugged into my MacBook Pro. I had it set up to work this way on my old MBP but I got a new MBP with Mountian Lion and the Display set up seen different and I can figure out how to make my Apple HD display (about 3 years old) be the main display when I turn on my MBP. Mirror is off when I look at
System pref’s – Display – Arrangement I just get to pick which display is left and right. I cant remember how it was set up on my old MBP. Mirroring does me no good. Any help will do!!!
Thanks BradDrag the menu bar in the picture to the picture of the other display.
-
How to make the display of custom column names in UWL(not bother abt values
Hi all
i want to make the display of custom column names in UWL ( for example GP)
i dont want or not looking about values for those custom columns . i know that thru custom connector we can achieve to retrieve the values for those custom columns. but currently i am looking only just to display the custom column names( for example GP custom column names, just i want to display the name of the columns ) in UWL .
Thanks
SunilHello Prashant,
You can add the control to your custom pagelayout, the following article has an example:
http://spandps.com/2012/02/22/showing-the-audience-target-field-in-an-editmodepanel-sharepoint-sp2010-in-projectserver-ps2010/
Btw, the SPFieldTargetToControl has a required property:
http://msdn.microsoft.com/en-us/library/microsoft.office.server.webcontrols.fieldtypes.spfieldtargettocontrol.required(v=office.14).aspx
- Dennis | Netherlands | Blog |
Twitter -
How to make the labels vertical in a horizonal bar chart?
Hi,
I am using CF 9. I have a horizontal bar chart. How can I make the labels on the Y-Axis display horizontally. Right now they are vertical and sort of sideways.
Below is a snipept from my <cfchart>. Everything is working, I just want the labels to display horizontally. How can I do this?
<cfchart
format="png"
chartheight="310" chartwidth="530" foregroundcolor="##000000"
show3d="false"
scalefrom="0" scaleto="14"
showlegend="no"
showxgridlines="yes"
showygridlines="no"
showborder="no"
style="#elementStyle#" >
<cfchartseries type="horizontalbar" paintstyle="shade"">
</cfchartseries>
</cfchart>
Thanks...When you open the default New Tab page - about:newtab - which has the Tiles and a Search Bar, the "focus" is in the Search Bar. You could change a hidden setting to have a blank page when you open a new tab if that's what you want - that will have the "focus" in the Location Bar . URL Bar.
Type '''about:config''' in the URL bar and hit Enter.
''Accept the warning''
Search field at the top to filter with this - '''browser.newtab.url'''
Right-click the preference that appears below, and select '''Modify'''.
Insert '''about:blank''' for the new string value. -
How to make JComboBox display an item not in list?
hi,
i'd like a gui component which is basically a jcombobox that presents a list A,B,C,D.
The combobox is paired with another gui component which allows choosing sets of items. A etc.. represent preselected sets of items, so the user can click on A and a particular set would be selected.
My problem is what to have the JComboBox do when the user selects a set of items that is not in the preselected defaults list. It would be nice to have the JComboBox just say "Other" at the top or something, but I can't figure out a way of doing this without putting the String "Other" in the list of items..
does anyone have any idea of how to approach this? (I looked at making the JComboBox editable but this seems a little complicated?)
thanks,
asjfYour best option and cleanest design is to have a
dummy data item in your list for "none of the above". thanks for the reply - this is what I'm doing at the moment. The problem is that I'm expecting testers to legitimately complain that selecting "None of the above" doesn't do anything, and doesn't really make sense ( it could make a random selection :o) )
i think i agree that adding functionality to do this "properly" is likely to be more work/pain than its worth..
Only an editable combobox can display something not in the list.this might help - if I could block mouse clicks to the editable area, and write to it programmatically but think this is probably quite difficult (?)
asjf -
How to make jcombobox display all by itlself?
Hello all -
Is there a way to make a jcombobox object display its column of items implicitly?
For example, suppose a program has a combobox filled up with names. And, suppose the first item says "toggle sort", which affects how the items are sorted in the combobox (eg, pressing it should cause the list to sort the displayed names based on first name, another press bases the sort on the last name...). The behavior I am aiming for is that when the user presses the "toggle sort" item, the combobox displays its items again awaiting further selection from the user (but not the first item). Know how to fire such an event?
private void namesComboBoxActionPerformed(ActionEvent evt) {
int selected = namesComboBox.getSelectedIndex();
if (selected == 0) {
// some code should result in the namesComboBox displaying its items again. What is it please?
}Here is a simple code, I don't know if its the correct way to do this sort of thing but it works:
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Collections;
import javax.swing.*;
* Sorting Combobox....
* @author talha
public class ComboSort extends JFrame{
ArrayList<ComboData> data;
JComboBox combo;
public ComboSort() {
super("Combo Sorting");
setDefaultCloseOperation(EXIT_ON_CLOSE);
populateData();
Collections.sort(data);
// I don't know how much of the combobox model should be overridden!
combo=new JComboBox(new DefaultComboBoxModel() {
@Override
public Object getElementAt(int index) {
return (index==0)?"Toggle Sort":data.get(index-1);
@Override
public int getSize() {
return data.size()+1;
@Override
public int getIndexOf(Object anObject) {
return (anObject instanceof String)?0:data.indexOf(anObject)+1;
combo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(combo.getSelectedIndex()==0){
ComboData.toggleSort();
Collections.sort(data);
//edited to make the pop up visible....
SwingUtilities.invokeLater(new Runnable() {
public void run() {
combo.setPopupVisible(true);
combo.setRenderer(new DefaultListCellRenderer() {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
Component renderer=super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if(value instanceof String){
renderer.setForeground(Color.BLUE);
renderer.setBackground(Color.YELLOW);
return renderer;
// you can remove following....
SwingUtilities.invokeLater(new Runnable() {
public void run() {
combo.setSelectedIndex(0);
getContentPane().setLayout(new FlowLayout());
getContentPane().add(new JLabel("Heads of State:"));
getContentPane().add(combo);
setSize(300, 300);
setLocationRelativeTo(null);
private void populateData() {
data=new ArrayList<ComboData>();
data.add(new ComboData("Barak", "Obama"));
data.add(new ComboData("Gordon", "Brown"));
data.add(new ComboData("Nicolas", "Sarkozy"));
data.add(new ComboData("Angela", "Merkel"));
data.add(new ComboData("Wen", "Jiabao"));
data.add(new ComboData("Taro", "Aso"));
data.add(new ComboData("Manmohan", "Singh"));
data.add(new ComboData("Asif", "Zardari"));
data.add(new ComboData("Mahmoud", "Ahmedinejad"));
data.add(new ComboData("Hugo", "Chavez"));
data.add(new ComboData("Raul", "Castro"));
public static void main(String args[]){
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new ComboSort().setVisible(true);
class ComboData implements Comparable{
String firstname;
String lastname;
static boolean sortFirstName;
public ComboData(String firstname, String lastname) {
this.firstname = firstname;
this.lastname = lastname;
@Override
public String toString() {
return firstname+" "+lastname;
public static void toggleSort(){
sortFirstName=!sortFirstName;
public int compareTo(Object o) {
ComboData other=(ComboData)o;
if(sortFirstName)return firstname.compareTo(other.firstname);
else return lastname.compareTo(other.lastname);
}Thanks!
Edit: Reread your original post and made few editions... but I still don't think that this is what you need (but now its much better) :-)
Edited by: T.B.M on Apr 19, 2009 1:16 PM -
How to make the jtoolbar vertical for the following code
public class JToolBarExample extends JFrame
implements ItemListener {
private BrowserToolBar toolbar;
private JCheckBox labelBox;
public static void main(String[] args) {
new JToolBarExample();
public JToolBarExample() {
super("JToolBar Example");
WindowUtilities.setNativeLookAndFeel();
addWindowListener(new ExitListener());
Container content = getContentPane();
content.setBackground(Color.white);
//orientation = BrowserToolBar.VERTICAL;
toolbar = new BrowserToolBar();
content.add(toolbar,BorderLayout.NORTH);
labelBox = new JCheckBox("Show Text Labels?");
labelBox.setHorizontalAlignment(SwingConstants.CENTER);
labelBox.addItemListener(this);
content.add(new JTextArea(10,30), BorderLayout.CENTER);
content.add(labelBox, BorderLayout.SOUTH);
pack();
setVisible(true);
public void itemStateChanged(ItemEvent event) {
toolbar.setTextLabels(labelBox.isSelected());
pack();
if we run the above code with all other supported classes,we get a toolbar with all the labels and images in horzontal direction,but i want to get my jtoolbar vertical,and it should be floatable,
so what changes i have to make to the code.
Normally it s enough if we declare it as JToolBar.VERTICAL
but it is not working over here,i mean where we have to declare this sentence.
please help me
thankyouWhen you post code use the "code" formatting tags so the code is readable.
Read the API there is a constructor and a method to control the orientation of a toolbar. -
How to make accounts display only via authorizations?
Has anyone setup CRM 2007 to get the account page to be display only? We don't want to allow certain users to manage accounts directly in CRM and would like to lock this down via authorization objects. We can't seem to figure out what authorization objects are needed to lock it down appropriately. Thanks in advance.
Hi James,
We've had a similar requirement. We used sap note 1260695.
Using this BAdI you can customize that depending on the BP role, some areas (e.g. marketing attributes) are
editable, and others (e.g. address data) are only displayed.
As an alternative, you can use note:
Note 1259940 - Authority check for accounts depending on roles
Hope this helps.
Regards,
Wim Olieman -
How can make JTextField display all ASCII character?
I am writing a java app. There is a Jtextfield . I need display some special character in this jtextfield such as ASCII code is 135(‡), 164(¤), 167(§) and so on. Thees characters whose ASCII code is 164, 167 can correctly display in spite of you set any font to this jtextfield. But the character whose ASCII code is 135 can`t correctly display. It display as a [];. Who knows and has some ideas?
Thx. BobThx any way.
Now I found a another way to display the (char)135(display as "�").
First, i defined a static attribute :
public final static String ASCII_CODE_IS_135 = "�";
Then, When I need display the char, I display the static attribute value. I found the textfield almost can display all special character by this way in spite of using what font.
Thx again. -
How to make totem display subtitles of xvid movie
I am informed that xine-lib and totem are enable to load subtitles of a Xvid movie, but I just can't turn it on, anybody has successed? I usually have two kinds of subtitle, one is srt format, the other is idx and sub format.
I got some hint on hadess | totem website,
External subtitle support (only on the command-line, use like: totem file:///file.avi#subtitle:file.sub)
I will try it when coming back home.
PS, very nice to see in his website, there is "official" archlinux totem package listed but linked to describing page of Arch site, haha. -
How to make buttons display in correct location
Hi, I am trying to adapt a dreamweaver template. I have to
place a set of buttons to the left of the design. If I place my
buttons in a new layer over an existing cell, I can get it all to
look fine in the WYSIWYG editor, but on f12 preview in browser the
buttons are completely in the wrong place. Would really welcome any
pointers to solving this ... Thank you. As you have probably
guessed I am new to dreamweaver...> As you have probably
> guessed I am new to dreamweaver...
Being new to Dreamweaver is of no consequence, but being new
to HTML and CSS
is critical. DW will punish you badly if you have no
familiarity with HTML
and CSS. Please take the time to study these techniques
before getting
yourself too frustrated.
We cannot answer any layout question without seeing your
code, really. But
from this -
> If I place my buttons in a new layer
we can deduce that you are using absolute positioning to try
to align your
buttons. The thing about absolute positioning is that it
places the
elements ABSOLUTELY on the screen - they stay in exactly that
location no
matter what else happens on the page. It sounds like you have
some other
centering elements on the page that are moving away from the
placement of
the buttons when you actually render the page in the browser.
It's
situations like this that cause us to try to tell people that
a) there is no
such thing as WYSIWYG, and b) using DW without understanding
the underlying
code will likely be a failure.
The solution to your problem will be one of the following -
a) don't use absolutely positioned elements to hold your
buttons - place
them in a container that follows the normal flow of the page
instead
b) wrap the page in a relatively positioned, centering
container so that
when the container centers, it carries the absolutely
positioned elements
along with it
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"c_a_n_v_a_s" <[email protected]> wrote in
message
news:[email protected]...
> Hi, I am trying to adapt a dreamweaver template. I have
to place a set of
> buttons to the left of the design. If I place my buttons
in a new layer
> over an
> existing cell, I can get it all to look fine in the
WYSIWYG editor, but on
> f12
> preview in browser the buttons are completely in the
wrong place. Would
> really
> welcome any pointers to solving this ... Thank you. As
you have probably
> guessed I am new to dreamweaver...
> -
I have a macbook pro 10.6.8. The screen displays vertical grey lines. I tried Crtl.command.eject... Did not work. I tried Command.crtl.p.r. way; Didnt work. What is wrong with my mac and how can i fix it?
NVRAM reset is command, option, P and R.
Restart the computer and immediately hold the four keys down. Keep holding the keys down, and let the Mac chime three times, then release the keys. Be patient it could take some time.
That being said what you describe may be a hardware issue, so the NVRAM reset probably won't work.
You can get a free diagnosis at an Apple genius bar. Make an appointment and take the MBP in,
http://www.apple.com/retail/geniusbar/ -
I am trying to add 3 grouped vertical radio buttons where one is on each line of a 3 row table. When I group the 3 buttons it squeezes them into one row, is there a way I can have them grouped and one in each.
Also, I would like to know how to make part of the form highlight when one of the 3 buttons is selectedHi,
If I am not wrong, a table cell can hold only one component or none. In order to place the radio group to different positions vertically, you can use subforms instead of table.
Asiye -
My spry horizontal menu bar is now displaying vertical. How do I fix it?
My horizontal spry menu bar displays correctly at http://www.matthewvandyke.com/ar/photos/ but displays vertical at http://www.matthewvandyke.com/ar/about.html. It started doing this a few days ago and I am not sure why.
Can anyone take a look at this code and tell me why this would be happening?
Here is the code:
about.html
(the relevant code from this page)
<div id="topNavigation">
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="الصفحة" _mce_href="http://www.matthewvandyke.com/ar/">الصفحة">http://www.matthewvandyke.com/ar/"> الصفحة الرئيسية</a></li>
<li><a href="حول" _mce_href="http://www.matthewvandyke.com/about.html">حول">http://www.matthewvandyke.com/a bout.html">حول ماثيو فاندايك</a></li>
<li><a href="الكتابhttp://www.matthewvandyke.com/book.html">الكتاب</a></li>
<li><a href="الفيلمhttp://www.matthewvandyke.com/film.html">الفيلم</a></li>
<li><a href="مقاتل" _mce_href="http://www.matthewvandyke.com/about.html#freedom-fighter">مقاتل">http://www.ma tthewvandyke.com/about.html#freedom-fighter">مقاتل الحرية</a></li>
<li><a href="مغامراتhttp://www.matthewvandyke.com/about.html#adventures">مغامرات</a></li>
<li><a href="تحليلاتhttp://www.matthewvandyke.com/analyst.html">تحليلات</a></li>
<li><a href="الحقائقhttp://www.matthewvandyke.com/the-facts.html">الحقائق</a></li>
<li><a href="الصورhttp://www.matthewvandyke.com/ar/photos/">الصور</a></li>
<li><a href="الفيديوhttp://www.matthewvandyke.com/video/">الفيديو</a></li>
<li><a href="المدونةhttp://www.matthewvandyke.com/blog/">المدونة</a></li>
<li><a href="الصحافةhttp://www.matthewvandyke.com/press.html">الصحافة</a></li>
<li><a href="الأحداث" _mce_href="http://www.matthewvandyke.com/events/">الأحداث">http://www.matthewvandyke.com/ events/">الأحداث والمناسبات</a></li>
<li><a href="الرعاةhttp://www.matthewvandyke.com/sponsors/">الرعاة</a></li>
<li><a href="وسائل" _mce_href="http://www.matthewvandyke.com/social-media.html">وسائل">http://www.matthewvand yke.com/social-media.html">وسائل الإعلام الاجتماعية</a></li>
</ul>
</div>
SpryMenuBarHorizontal.css
@charset "UTF-8";
/* SpryMenuBarHorizontal.css - version 0.6 - Spry Pre-Release 1.6.1 */
/* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
LAYOUT INFORMATION: describes box model, positioning, z-order
/* The outermost container of the Menu Bar, an auto width box with no margin or padding */
ul.MenuBarHorizontal
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
cursor: default;
width: auto;
/* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
ul.MenuBarActive
z-index: 1000;
/* Menu item containers, position children relative to this container and are a fixed width */
ul.MenuBarHorizontal li
margin: 0 .15em;
padding: 0;
list-style-type: none;
font-size: 100%;
position: relative;
text-align: left;
cursor: pointer;
width: auto;
float: left;
/* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
ul.MenuBarHorizontal ul
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
z-index: 1020;
cursor: default;
width: auto;
position: absolute;
left: -1000em;
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
left: auto;
/* Menu item containers are same fixed width as parent */
ul.MenuBarHorizontal ul li
display: block;
float: none;
width: auto;
white-space: nowrap;
/* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
ul.MenuBarHorizontal ul ul
position: absolute;
margin: -5% 0 0 95%;
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
left: auto;
top: 0;
DESIGN INFORMATION: describes color scheme, borders, fonts
/* Submenu containers have borders on all sides */
ul.MenuBarHorizontal ul
border: 1px solid #CCC;
/* Menu items are a light gray block with padding and no text decoration */
ul.MenuBarHorizontal a
display: block;
cursor: pointer;
background-color: #000000;
padding: 0.4em 0.15em;
color: #FFFFFF;
text-decoration: none;
/* Menu items that have mouse over or focus have a blue background and white text */
ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
background-color: #d6c7a6;
color: #000;
/* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
background-color: #d6c7a6;
color: #000;
SUBMENU INDICATION: styles if there is a submenu under a given menu item
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenu
background-image: url(SpryMenuBarDown.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
padding: 0.4em 0.15em;
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
background-image: url(SpryMenuBarRight.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
background-image: url(SpryMenuBarDownHover.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
background-image: url(SpryMenuBarRightHover.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
BROWSER HACKS: the hacks below should not be changed unless you are an expert
/* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
ul.MenuBarHorizontal iframe
position: absolute;
z-index: 1010;
filter:alpha(opacity:0.1);
/* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
@media screen, projection
ul.MenuBarHorizontal li.MenuBarItemIE
display: inline;
f\loat: left;
background: #FFF;
SpryMenuBar.js
// SpryMenuBar.js - version 0.12 - Spry Pre-Release 1.6.1
// Copyright (c) 2006. Adobe Systems Incorporated.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Adobe Systems Incorporated nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
SpryMenuBar.js
This file handles the JavaScript for Spry Menu Bar. You should have no need
to edit this file. Some highlights of the MenuBar object is that timers are
used to keep submenus from showing up until the user has hovered over the parent
menu item for some time, as well as a timer for when they leave a submenu to keep
showing that submenu until the timer fires.
var Spry; if (!Spry) Spry = {}; if (!Spry.Widget) Spry.Widget = {};
Spry.BrowserSniff = function()
var b = navigator.appName.toString();
var up = navigator.platform.toString();
var ua = navigator.userAgent.toString();
this.mozilla = this.ie = this.opera = this.safari = false;
var re_opera = /Opera.([0-9\.]*)/i;
var re_msie = /MSIE.([0-9\.]*)/i;
var re_gecko = /gecko/i;
var re_safari = /(applewebkit|safari)\/([\d\.]*)/i;
var r = false;
if ( (r = ua.match(re_opera))) {
this.opera = true;
this.version = parseFloat(r[1]);
} else if ( (r = ua.match(re_msie))) {
this.ie = true;
this.version = parseFloat(r[1]);
} else if ( (r = ua.match(re_safari))) {
this.safari = true;
this.version = parseFloat(r[2]);
} else if (ua.match(re_gecko)) {
var re_gecko_version = /rv:\s*([0-9\.]+)/i;
r = ua.match(re_gecko_version);
this.mozilla = true;
this.version = parseFloat(r[1]);
this.windows = this.mac = this.linux = false;
this.Platform = ua.match(/windows/i) ? "windows" :
(ua.match(/linux/i) ? "linux" :
(ua.match(/mac/i) ? "mac" :
ua.match(/unix/i)? "unix" : "unknown"));
this[this.Platform] = true;
this.v = this.version;
if (this.safari && this.mac && this.mozilla) {
this.mozilla = false;
Spry.is = new Spry.BrowserSniff();
// Constructor for Menu Bar
// element should be an ID of an unordered list (<ul> tag)
// preloadImage1 and preloadImage2 are images for the rollover state of a menu
Spry.Widget.MenuBar = function(element, opts)
this.init(element, opts);
Spry.Widget.MenuBar.prototype.init = function(element, opts)
this.element = this.getElement(element);
// represents the current (sub)menu we are operating on
this.currMenu = null;
this.showDelay = 250;
this.hideDelay = 600;
if(typeof document.getElementById == 'undefined' || (navigator.vendor == 'Apple Computer, Inc.' && typeof window.XMLHttpRequest == 'undefined') || (Spry.is.ie && typeof document.uniqueID == 'undefined'))
// bail on older unsupported browsers
return;
// Fix IE6 CSS images flicker
if (Spry.is.ie && Spry.is.version < 7){
try {
document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
this.upKeyCode = Spry.Widget.MenuBar.KEY_UP;
this.downKeyCode = Spry.Widget.MenuBar.KEY_DOWN;
this.leftKeyCode = Spry.Widget.MenuBar.KEY_LEFT;
this.rightKeyCode = Spry.Widget.MenuBar.KEY_RIGHT;
this.escKeyCode = Spry.Widget.MenuBar.KEY_ESC;
this.hoverClass = 'MenuBarItemHover';
this.subHoverClass = 'MenuBarItemSubmenuHover';
this.subVisibleClass ='MenuBarSubmenuVisible';
this.hasSubClass = 'MenuBarItemSubmenu';
this.activeClass = 'MenuBarActive';
this.isieClass = 'MenuBarItemIE';
this.verticalClass = 'MenuBarVertical';
this.horizontalClass = 'MenuBarHorizontal';
this.enableKeyboardNavigation = true;
this.hasFocus = false;
// load hover images now
if(opts)
for(var k in opts)
if (typeof this[k] == 'undefined')
var rollover = new Image;
rollover.src = opts[k];
Spry.Widget.MenuBar.setOptions(this, opts);
// safari doesn't support tabindex
if (Spry.is.safari)
this.enableKeyboardNavigation = false;
if(this.element)
this.currMenu = this.element;
var items = this.element.getElementsByTagName('li');
for(var i=0; i<items.length; i++)
if (i > 0 && this.enableKeyboardNavigation)
items[i].getElementsByTagName('a')[0].tabIndex='-1';
this.initialize(items[i], element);
if(Spry.is.ie)
this.addClassName(items[i], this.isieClass);
items[i].style.position = "static";
if (this.enableKeyboardNavigation)
var self = this;
this.addEventListener(document, 'keydown', function(e){self.keyDown(e); }, false);
if(Spry.is.ie)
if(this.hasClassName(this.element, this.verticalClass))
this.element.style.position = "relative";
var linkitems = this.element.getElementsByTagName('a');
for(var i=0; i<linkitems.length; i++)
linkitems[i].style.position = "relative";
Spry.Widget.MenuBar.KEY_ESC = 27;
Spry.Widget.MenuBar.KEY_UP = 38;
Spry.Widget.MenuBar.KEY_DOWN = 40;
Spry.Widget.MenuBar.KEY_LEFT = 37;
Spry.Widget.MenuBar.KEY_RIGHT = 39;
Spry.Widget.MenuBar.prototype.getElement = function(ele)
if (ele && typeof ele == "string")
return document.getElementById(ele);
return ele;
Spry.Widget.MenuBar.prototype.hasClassName = function(ele, className)
if (!ele || !className || !ele.className || ele.className.search(new RegExp("\\b" + className + "\\b")) == -1)
return false;
return true;
Spry.Widget.MenuBar.prototype.addClassName = function(ele, className)
if (!ele || !className || this.hasClassName(ele, className))
return;
ele.className += (ele.className ? " " : "") + className;
Spry.Widget.MenuBar.prototype.removeClassName = function(ele, className)
if (!ele || !className || !this.hasClassName(ele, className))
return;
ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
// addEventListener for Menu Bar
// attach an event to a tag without creating obtrusive HTML code
Spry.Widget.MenuBar.prototype.addEventListener = function(element, eventType, handler, capture)
try
if (element.addEventListener)
element.addEventListener(eventType, handler, capture);
else if (element.attachEvent)
element.attachEvent('on' + eventType, handler);
catch (e) {}
// createIframeLayer for Menu Bar
// creates an IFRAME underneath a menu so that it will show above form controls and ActiveX
Spry.Widget.MenuBar.prototype.createIframeLayer = function(menu)
var layer = document.createElement('iframe');
layer.tabIndex = '-1';
layer.src = 'javascript:""';
layer.frameBorder = '0';
layer.scrolling = 'no';
menu.parentNode.appendChild(layer);
layer.style.left = menu.offsetLeft + 'px';
layer.style.top = menu.offsetTop + 'px';
layer.style.width = menu.offsetWidth + 'px';
layer.style.height = menu.offsetHeight + 'px';
// removeIframeLayer for Menu Bar
// removes an IFRAME underneath a menu to reveal any form controls and ActiveX
Spry.Widget.MenuBar.prototype.removeIframeLayer = function(menu)
var layers = ((menu == this.element) ? menu : menu.parentNode).getElementsByTagName('iframe');
while(layers.length > 0)
layers[0].parentNode.removeChild(layers[0]);
// clearMenus for Menu Bar
// root is the top level unordered list (<ul> tag)
Spry.Widget.MenuBar.prototype.clearMenus = function(root)
var menus = root.getElementsByTagName('ul');
for(var i=0; i<menus.length; i++)
this.hideSubmenu(menus[i]);
this.removeClassName(this.element, this.activeClass);
// bubbledTextEvent for Menu Bar
// identify bubbled up text events in Safari so we can ignore them
Spry.Widget.MenuBar.prototype.bubbledTextEvent = function()
return Spry.is.safari && (event.target == event.relatedTarget.parentNode || (event.eventPhase == 3 && event.target.parentNode == event.relatedTarget));
// showSubmenu for Menu Bar
// set the proper CSS class on this menu to show it
Spry.Widget.MenuBar.prototype.showSubmenu = function(menu)
if(this.currMenu)
this.clearMenus(this.currMenu);
this.currMenu = null;
if(menu)
this.addClassName(menu, this.subVisibleClass);
if(typeof document.all != 'undefined' && !Spry.is.opera && navigator.vendor != 'KDE')
if(!this.hasClassName(this.element, this.horizontalClass) || menu.parentNode.parentNode != this.element)
menu.style.top = menu.parentNode.offsetTop + 'px';
if(Spry.is.ie && Spry.is.version < 7)
this.createIframeLayer(menu);
this.addClassName(this.element, this.activeClass);
// hideSubmenu for Menu Bar
// remove the proper CSS class on this menu to hide it
Spry.Widget.MenuBar.prototype.hideSubmenu = function(menu)
if(menu)
this.removeClassName(menu, this.subVisibleClass);
if(typeof document.all != 'undefined' && !Spry.is.opera && navigator.vendor != 'KDE')
menu.style.top = '';
menu.style.left = '';
if(Spry.is.ie && Spry.is.version < 7)
this.removeIframeLayer(menu);
// initialize for Menu Bar
// create event listeners for the Menu Bar widget so we can properly
// show and hide submenus
Spry.Widget.MenuBar.prototype.initialize = function(listitem, element)
var opentime, closetime;
var link = listitem.getElementsByTagName('a')[0];
var submenus = listitem.getElementsByTagName('ul');
var menu = (submenus.length > 0 ? submenus[0] : null);
if(menu)
this.addClassName(link, this.hasSubClass);
if(!Spry.is.ie)
// define a simple function that comes standard in IE to determine
// if a node is within another node
listitem.contains = function(testNode)
// this refers to the list item
if(testNode == null)
return false;
if(testNode == this)
return true;
else
return this.contains(testNode.parentNode);
// need to save this for scope further down
var self = this;
this.addEventListener(listitem, 'mouseover', function(e){self.mouseOver(listitem, e);}, false);
this.addEventListener(listitem, 'mouseout', function(e){if (self.enableKeyboardNavigation) self.clearSelection(); self.mouseOut(listitem, e);}, false);
if (this.enableKeyboardNavigation)
this.addEventListener(link, 'blur', function(e){self.onBlur(listitem);}, false);
this.addEventListener(link, 'focus', function(e){self.keyFocus(listitem, e);}, false);
Spry.Widget.MenuBar.prototype.keyFocus = function (listitem, e)
this.lastOpen = listitem.getElementsByTagName('a')[0];
this.addClassName(this.lastOpen, listitem.getElementsByTagName('ul').length > 0 ? this.subHoverClass : this.hoverClass);
this.hasFocus = true;
Spry.Widget.MenuBar.prototype.onBlur = function (listitem)
this.clearSelection(listitem);
Spry.Widget.MenuBar.prototype.clearSelection = function(el){
//search any intersection with the current open element
if (!this.lastOpen)
return;
if (el)
el = el.getElementsByTagName('a')[0];
// check children
var item = this.lastOpen;
while (item != this.element)
var tmp = el;
while (tmp != this.element)
if (tmp == item)
return;
try{
tmp = tmp.parentNode;
}catch(err){break;}
item = item.parentNode;
var item = this.lastOpen;
while (item != this.element)
this.hideSubmenu(item.parentNode);
var link = item.getElementsByTagName('a')[0];
this.removeClassName(link, this.hoverClass);
this.removeClassName(link, this.subHoverClass);
item = item.parentNode;
this.lastOpen = false;
Spry.Widget.MenuBar.prototype.keyDown = function (e)
if (!this.hasFocus)
return;
if (!this.lastOpen)
this.hasFocus = false;
return;
var e = e|| event;
var listitem = this.lastOpen.parentNode;
var link = this.lastOpen;
var submenus = listitem.getElementsByTagName('ul');
var menu = (submenus.length > 0 ? submenus[0] : null);
var hasSubMenu = (menu) ? true : false;
var opts = [listitem, menu, null, this.getSibling(listitem, 'previousSibling'), this.getSibling(listitem, 'nextSibling')];
if (!opts[3])
opts[2] = (listitem.parentNode.parentNode.nodeName.toLowerCase() == 'li')?listitem.parentNode.parentNode:null;
var found = 0;
switch (e.keyCode){
case this.upKeyCode:
found = this.getElementForKey(opts, 'y', 1);
break;
case this.downKeyCode:
found = this.getElementForKey(opts, 'y', -1);
break;
case this.leftKeyCode:
found = this.getElementForKey(opts, 'x', 1);
break;
case this.rightKeyCode:
found = this.getElementForKey(opts, 'x', -1);
break;
case this.escKeyCode:
case 9:
this.clearSelection();
this.hasFocus = false;
default: return;
switch (found)
case 0: return;
case 1:
//subopts
this.mouseOver(listitem, e);
break;
case 2:
//parent
this.mouseOut(opts[2], e);
break;
case 3:
case 4:
// left - right
this.removeClassName(link, hasSubMenu ? this.subHoverClass : this.hoverClass);
break;
var link = opts[found].getElementsByTagName('a')[0];
if (opts[found].nodeName.toLowerCase() == 'ul')
opts[found] = opts[found].getElementsByTagName('li')[0];
this.addClassName(link, opts[found].getElementsByTagName('ul').length > 0 ? this.subHoverClass : this.hoverClass);
this.lastOpen = link;
opts[found].getElementsByTagName('a')[0].focus();
//stop further event handling by the browser
return Spry.Widget.MenuBar.stopPropagation(e);
Spry.Widget.MenuBar.prototype.mouseOver = function (listitem, e)
var link = listitem.getElementsByTagName('a')[0];
var submenus = listitem.getElementsByTagName('ul');
var menu = (submenus.length > 0 ? submenus[0] : null);
var hasSubMenu = (menu) ? true : false;
if (this.enableKeyboardNavigation)
this.clearSelection(listitem);
if(this.bubbledTextEvent())
// ignore bubbled text events
return;
if (listitem.closetime)
clearTimeout(listitem.closetime);
if(this.currMenu == listitem)
this.currMenu = null;
// move the focus too
if (this.hasFocus)
link.focus();
// show menu highlighting
this.addClassName(link, hasSubMenu ? this.subHoverClass : this.hoverClass);
this.lastOpen = link;
if(menu && !this.hasClassName(menu, this.subHoverClass))
var self = this;
listitem.opentime = window.setTimeout(function(){self.showSubmenu(menu);}, this.showDelay);
Spry.Widget.MenuBar.prototype.mouseOut = function (listitem, e)
var link = listitem.getElementsByTagName('a')[0];
var submenus = listitem.getElementsByTagName('ul');
var menu = (submenus.length > 0 ? submenus[0] : null);
var hasSubMenu = (menu) ? true : false;
if(this.bubbledTextEvent())
// ignore bubbled text events
return;
var related = (typeof e.relatedTarget != 'undefined' ? e.relatedTarget : e.toElement);
if(!listitem.contains(related))
if (listitem.opentime)
clearTimeout(listitem.opentime);
this.currMenu = listitem;
// remove menu highlighting
this.removeClassName(link, hasSubMenu ? this.subHoverClass : this.hoverClass);
if(menu)
var self = this;
listitem.closetime = window.setTimeout(function(){self.hideSubmenu(menu);}, this.hideDelay);
if (this.hasFocus)
link.blur();
Spry.Widget.MenuBar.prototype.getSibling = function(element, sibling)
var child = element[sibling];
while (child && child.nodeName.toLowerCase() !='li')
child = child[sibling];
return child;
Spry.Widget.MenuBar.prototype.getElementForKey = function(els, prop, dir)
var found = 0;
var rect = Spry.Widget.MenuBar.getPosition;
var ref = rect(els[found]);
var hideSubmenu = false;
//make the subelement visible to compute the position
if (els[1] && !this.hasClassName(els[1], this.MenuBarSubmenuVisible))
els[1].style.visibility = 'hidden';
this.showSubmenu(els[1]);
hideSubmenu = true;
var isVert = this.hasClassName(this.element, this.verticalClass);
var hasParent = els[0].parentNode.parentNode.nodeName.toLowerCase() == 'li' ? true : false;
for (var i = 1; i < els.length; i++){
//when navigating on the y axis in vertical menus, ignore children and parents
if(prop=='y' && isVert && (i==1 || i==2))
continue;
//when navigationg on the x axis in the FIRST LEVEL of horizontal menus, ignore children and parents
if(prop=='x' && !isVert && !hasParent && (i==1 || i==2))
continue;
if (els[i])
var tmp = rect(els[i]);
if ( (dir * tmp[prop]) < (dir * ref[prop]))
ref = tmp;
found = i;
// hide back the submenu
if (els[1] && hideSubmenu){
this.hideSubmenu(els[1]);
els[1].style.visibility = '';
return found;
Spry.Widget.MenuBar.camelize = function(str)
if (str.indexOf('-') == -1){
return str;
var oStringList = str.split('-');
var isFirstEntry = true;
var camelizedString = '';
for(var i=0; i < oStringList.length; i++)
if(oStringList[i].length>0)
if(isFirstEntry)
camelizedString = oStringList[i];
isFirstEntry = false;
else
var s = oStringList[i];
camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
return camelizedString;
Spry.Widget.MenuBar.getStyleProp = function(element, prop)
var value;
try
if (element.style)
value = element.style[Spry.Widget.MenuBar.camelize(prop)];
if (!value)
if (document.defaultView && document.defaultView.getComputedStyle)
var css = document.defaultView.getComputedStyle(element, null);
value = css ? css.getPropertyValue(prop) : null;
else if (element.currentStyle)
value = element.currentStyle[Spry.Widget.MenuBar.camelize(prop)];
catch (e) {}
return value == 'auto' ? null : value;
Spry.Widget.MenuBar.getIntProp = function(element, prop)
var a = parseInt(Spry.Widget.MenuBar.getStyleProp(element, prop),10);
if (isNaN(a))
return 0;
return a;
Spry.Widget.MenuBar.getPosition = function(el, doc)
doc = doc || document;
if (typeof(el) == 'string') {
el = doc.getElementById(el);
if (!el) {
return false;
if (el.parentNode === null || Spry.Widget.MenuBar.getStyleProp(el, 'display') == 'none') {
//element must be visible to have a box
return false;
var ret = {x:0, y:0};
var parent = null;
var box;
if (el.getBoundingClientRect) { // IE
box = el.getBoundingClientRect();
var scrollTop = doc.documentElement.scrollTop || doc.body.scrollTop;
var scrollLeft = doc.documentElement.scrollLeft || doc.body.scrollLeft;
ret.x = box.left + scrollLeft;
ret.y = box.top + scrollTop;
} else if (doc.getBoxObjectFor) { // gecko
box = doc.getBoxObjectFor(el);
ret.x = box.x;
ret.y = box.y;
} else { // safari/opera
ret.x = el.offsetLeft;
ret.y = el.offsetTop;
parent = el.offsetParent;
if (parent != el) {
while (parent) {
ret.x += parent.offsetLeft;
ret.y += parent.offsetTop;
parent = parent.offsetParent;
// opera & (safari absolute) incorrectly account for body offsetTop
if (Spry.is.opera || Spry.is.safari && Spry.Widget.MenuBar.getStyleProp(el, 'position') == 'absolute')
ret.y -= doc.body.offsetTop;
if (el.parentNode)
parent = el.parentNode;
else
parent = null;
if (parent.nodeName){
var cas = parent.nodeName.toUpperCase();
while (parent && cas != 'BODY' && cas != 'HTML') {
cas = parent.nodeName.toUpperCase();
ret.x -= parent.scrollLeft;
ret.y -= parent.scrollTop;
if (parent.parentNode)
parent = parent.parentNode;
else
parent = null;
return ret;
Spry.Widget.MenuBar.stopPropagation = function(ev)
if (ev.stopPropagation)
ev.stopPropagation();
else
ev.cancelBubble = true;
if (ev.preventDefault)
ev.preventDefault();
else
ev.returnValue = false;
Spry.Widget.MenuBar.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
if (!optionsObj)
return;
for (var optionName in optionsObj)
if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
continue;
obj[optionName] = optionsObj[optionName];I have not seen your error in either my IE or my chrome. I do note that you are using a "strict" Document Type Declaration.
You might try a transitional DTD, which should be more forgiving than the strict:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Other than that, I don't see anything particular (because I don't see the error, either) that would cause the menu to drop vertically instead of horizontally.
Beth
Maybe you are looking for
-
Capture problem with Panasonic PV-GS35
I have tried for 2 days to find the answer to this . Suddenly I cannot capture video from my minidv camera via usb into Premiere Elements 3. At the capture screen in the upper left corner where the picture of a camera is has the exclamation point and
-
Errors installing BI Content for LES (Logistic Execution System)
I am on BI 7.0 SP17 and BI Content 703 level 09. I am trying to install BI Content for LES - cube 0LES_C01. However there are no updated components for Datasources, DTP etc. Only 3.x infosources etc. Does this mean that none of the BI Content for LES
-
WSAD Generate RMIC ResourceBundle Problem
Hello Everyone, If anyone could answer this, I'd be grateful. This has even IBM people stumped. I created a Resource Bundle in the src directory a WSAD project. It's named Messages_en_US.properties. I've tested getting strings from this resource bund
-
Calling a ILOG JRule based business rule from ABAP
Hi, JRule is a BRMS product from ILOG. I have few business rules maintained in JRule and exposed as JAX Web Service. I was wondering if it is possible to call those rules from ABAP using client proxy similar to the technique used to call Enterprise S
-
Cannot connect 2 macbooks to the internet through AEBS?
Hi, I have 2 Macbooks, Airport Extreme Base Station & a 320T D-link router. My ISP is plusnet who uses PPPoA settings on the d-link router. So i have set the router up and when i connect it to the Macbooks directly via ethernet i can access the inter