473,394 Members | 1,085 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

YUI Resizable panel

Hi
I am using YUI(Yahoo User Interface) Resizable panel as tool Tip.Now I need to close the panel on body click.Panel should not close if any event is performed in it .I try to close the panel by "<body onclick()>" .I thought trough that i can get the id of the element to close the panel but if i click on the panel i am getting both the id of panel (div id) followed by body id .How can i do this .Right now i am closing the panel with the close option in it.

thanks
Apr 29 '09 #1
3 1943
Ciary
247 Expert 100+
try this:
Expand|Select|Wrap|Line Numbers
  1. function click(id){
  2.    switch (id){
  3.       case idBody: {document.getElementByID('YUI').style.display='none';break}
  4.       case butID: {/*my function*/ break}
  5.       case ...
  6.       ...
  7.    }
  8. }
  9.  
i used something like this and it worked for me.
Apr 29 '09 #2
Hi
Thabk you for your reply.It work but i did some more changes.Your code is like if statement only.The function will be called each time . So i declared a global variable then it works fine.
Expand|Select|Wrap|Line Numbers
  1. var panelCloseValue=0;
  2. function closePanel(idVal){
  3.     switch(idVal){
  4.         case 'bodyId':{
  5.             if(panelCloseValue!=1){
  6.                 panel.hide();
  7.                 panelCloseValue=0;
  8.             }else{
  9.                 panelCloseValue=0;
  10.             }
  11.             break;
  12.         }
  13.         case 'examplecontainer':{
  14.             panelCloseValue=1;
  15.             break;
  16.         }
  17.     }
  18.     }
  19.  
In the above code only after declaring var panelCloseValue=0; it works otherwise it won't work
Apr 29 '09 #3
Dormilich
8,658 Expert Mod 8TB
small improvement...
Expand|Select|Wrap|Line Numbers
  1. var panelCloseValue=0;
  2. function closePanel(idVal){
  3.     switch(idVal){
  4.         case 'bodyId':{
  5.             if(panelCloseValue!=1){
  6.                 panel.hide();
  7.             }
  8.             panelCloseValue=0;
  9.             break;
  10.         }
  11.         case 'examplecontainer':{
  12.             panelCloseValue=1;
  13.             break;
  14.         }
  15.     }
  16. }
Apr 29 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: VR | last post by:
First, greetings to everyone :) I'm doing a university seminar & I've encountered a problem. I have a gallery with thumbnails linked on pictures. What I want is popup to be opened with...
1
by: pinocchio | last post by:
Hello, I have interesting problem. I need to create MDI application with custom MDI child's windows. MDI childs should have rounded corners and border with own style (not like windows default...
1
by: Eps | last post by:
I am developing a program which I plan to release as freeware at some point. I have decided that the lowest resolution supported will be 1024x768 and have sized everything up so the GUI is usable...
4
by: sam.s.kong | last post by:
Hello! I opened a new window using 'resizable=no'. Can the child window make itself resizable even if it's opened with 'resizable=no'? For example: <body onload="javascript:...
3
by: Al Henderson | last post by:
Morning All, I have a web application where we pop up a little calendar control in a new window to allow users to choose dates. For cross-browser purposes, this is done via window.open (with...
2
by: ssoffline | last post by:
hi I am developing an app for making data flow diagrams visually so i have a toolbox, from which i drag and drop objects onto a panel For obvious reasons i have lines which i use to connect...
3
by: Anupama | last post by:
Is it possible that first I make my window resizable,than if window is less than a fixed size I can make my window not resizable?Better to say can I change resizable feature during runtime?If...
3
by: Thierry Loiseau | last post by:
Hello, If I do : w=window.open('','a','resizable=no, width=400, height=400, toto=3'); can I modify 'w' to resizable=yes ? Thank you, Thierry
1
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.