473,386 Members | 1,745 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,386 software developers and data experts.

extended message box , how to do that ?

hello

this is my first time here , i used to enter your site and read the quistions and your answer , but this time i have a quistion , hoping that you will help me

i am new to javascript and DHTML , i want to make a help message [ using message box modle] that appear when user put the mouse in a text box within fourm , but i want this message to appear slowly from left to right [extended from the text box ] until the whole message appear , any idea to start with will be great .

thanx alot
Oct 21 '08 #1
8 1884
hmmmmm message box model? "extend"...do you want it to slide out as if from under the text box, or grow, like reveal the text from left to right.....and by slowly....how slowly?
Oct 21 '08 #2
hello

thanx for replaying , i want it to slide from the text box so doesn't appear in one time , it just look as it's width grown until the whole width appear
Oct 21 '08 #3
Markus
6,050 Expert 4TB
I'd suggest having a look at some of the javascript frameworks as most give you this sort of functionality plus much more!
Oct 21 '08 #4
Markus is right, you should definitely look into some frameworks, but since you said it's for a forum, this should work for what you need, but again....if you plan to continue enriching your website with javascript functionality....it would be a good idea to get something that does more:)

Like I said earlier Masarat, if you have questions about this just send me another message:)...

Expand|Select|Wrap|Line Numbers
  1. popUpMsgObj=false
  2. myPopUps=new Object()
  3. //Messages should be named the same as the inputs they are mapped to
  4. myPopUps.Messages={
  5.     postTitle:'this is a help message for the title',
  6.     postBody:'this is a help message for the body'
  7. }
  8. function gebi(id){return document.all?document.all[id]:document.getElementById(id)}
  9. function helpMessage(el){
  10.     if(!el.popUpMsg && !popUpMsgObj[el.id]){
  11.         if(popUpMsgObj){
  12.             var tmpEl=popUpMsgObj.el
  13.             clearInterval(tmpEl.popUpInt);
  14.             tmpEl.popUpInt=false;
  15.             document.body.removeChild(popUpMsgObj);
  16.             tmpEl.popUpMsg=false;
  17.             popUpMsgObj=false
  18.         }
  19.         el.popUpMsg=newPopUp(el)
  20.         popUpMsgObj=el.popUpMsg
  21.         openNewPopup=function(){openPopup(el.popUpMsg)}
  22.         el.popUpInt=setInterval("openNewPopup()",0)
  23.     }
  24. }
  25. function newPopUp(el){
  26.     var popup=document.createElement('div')
  27.     popup.style.position='absolute'
  28.     popup.style.top=el.offsetTop+'px'
  29.     popup.style.left=(el.offsetLeft+el.offsetWidth)+'px'
  30.     popup.style.width=0
  31.     popup.style.overflow='hidden'
  32.     popup.content=document.createElement('div')
  33.     popup.content.className='myPopupClass'
  34.     popup.content.style.position='absolute'
  35.     //popup.content.style.width=myPopUps.Styles.width+'px'
  36.     //popup.content.style.height=myPopUps.Styles.height+'px'
  37.     popup.content.innerHTML=myPopUps.Messages[el.id]
  38.     popup.appendChild(popup.content)
  39.     popup.el=el
  40.     document.body.appendChild(popup)
  41.     popup.style.height=popup.content.offsetHeight+'px'
  42.     return(popup)
  43. }
  44. function openPopup(o){
  45.     var popup=o
  46.     if(popup.offsetWidth>popup.content.offsetWidth){
  47.         clearInterval(popup.el.popUpInt)
  48.     }else{
  49.         popup.style.width=(popup.offsetWidth+10)+'px'
  50.     }
  51. }
[HTML]<input id="postTitle" name="postTitle" onmouseover="helpMessage(this)" /><br />
<input id="postBody" name="postBody" onmouseover="helpMessage(this)" />[/HTML]
Oct 21 '08 #5
Markus
6,050 Expert 4TB
Zaphod, the idea of this forum is that questions are posted in the forum. Otherwise, what is the point? We could just have an PMing system for people to discuss questions.

Now, I have noticed you're a very helpful contributor, so it makes sense for you to answer questions posted in the forums as these answers generate more google links.

Please do not reply to people who PM you with questions, but redirect them to post in the relevant forum.

Thanks for your time, Zaphod.
Oct 21 '08 #6
sorry Markus:) For everyone elses benefit:

Masarat said he has a forum, and he wants a "help box" to pop up from the input fields, he plans to use css to style the message, and the above code should be able to handle it cross-browser....you'll notice a couple lines commented out, 35 & 36, where I use "myPopUps.Styles". That is how I usually handle my styles since I don't use much css...if anyone else would like to use this and has problems I'm happy to help implement:)
Oct 22 '08 #7
hello

thanx alot zaphod 42 and markus for your replay , really thank you alot.

but i am still having the problem , i found a piece of code that do something like what i want , but what i found it is work on button click i want to do the same but in form text box "onfocus" so can you plz help me in that?

this is the piece of code that i found it

Expand|Select|Wrap|Line Numbers
  1.  
  2. <html>
  3. <head>
  4.   <script src="http://code.jquery.com/jquery-latest.js"></script>
  5.  
  6.   <script>
  7.   $(document).ready(function(){
  8.  
  9.     $("button").click(function () {
  10.       $("p").show("slow");
  11.     });
  12.  
  13.   });
  14.   </script>
  15.   <style>
  16.   p { background:yellow; }
  17.   </style>
  18. </head>
  19. <body>
  20.   <button>Show it</button>
  21.   <p style="display: none">Hello</p>
  22. </body>
  23. </html>
  24.  
  25.  
Oct 25 '08 #8
acoder
16,027 Expert Mod 8TB
Use focus() in place of click().
Oct 27 '08 #9

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

Similar topics

1
by: Alvaro G Vicario | last post by:
I really love the extended CHM format documentation. However, it apparently hasn't been updated since september 2003: http://www.php.net/docs-echm.php Does anyone know something about this?...
3
by: Bruce | last post by:
Since DBlib is no longer the suggested method for connecting back to sql server from an Extended Stored Procedure, has anyone built any extended stored procedures that use other connection methods...
3
by: bsandell | last post by:
We have an application that is based on several extended stored procedures. When we run our application in house, or when most other customers run it, they see performance of about X transactions...
13
by: bgbauer70 | last post by:
My appologies if this ends up being a duplicate post. For some reason the first post never showed up. I've tried about 300 iterrations of this same ability, and none of them seem to work in...
12
by: Jeremy | last post by:
Hi all, I'm getting very confused about how DB2 uses shared memory and I wonder if someone could clarify matters for me, please ? We are running 32bit DB2 V7.2 FP9 under AIX 4.3.3 on a machine...
1
by: Robert Hanson | last post by:
Hi All, Can anyone comment on whether of not Whidbey will provide better support for Extended MAPI so we can avoid the Outlook Warning Message? Thanks in advance, Bob Hanson Centare Group...
5
by: Stelrad Doulton | last post by:
Hi, Does anyone know what number to use with GetEncoding for 8 bit ASCI? Cheers
8
by: SpotNet | last post by:
Hello NewsGroup, I have a base class and six classes that inherit from this base class. All members in the base class are used in it's extended classes except, in one of the extended class one...
1
by: s123 | last post by:
Hi, while invoking a web service, if in xml request message i wrap the extended ASCII characters with CDATA it is not returning the desired result, while this is not the case if i do not wrap...
12
by: Fabien Henriet | last post by:
Hello, I got a problem when I try to extend a textbox. So I overwrite the Render method. For the stuff I try to do, I would like to add a custom attribute to my customized textbox. So it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.