Question

alan

New member
Question

I am not sure if it relates to PHP, but I need to know... how do they create the "open message" affect in the forum? So, that the rest of the page jusmp down or up? Thanks
 

אמיר ט

New member
Answer

this effect i done using JavaScript you can either loads all the messages into an array (using PHP/ASP/WHATEVER) or you load each message only when u need - the more complex way... either way, its not that simple and requires good knowledge of JavaScript.
 

alan

New member
OK... so, assuming I have the info

in an array in PHP (or saved in a DB)... what is the JavaScript in order to create that effect?
 

אמיר ט

New member
basicly...

so can use the someHtmlTag.innerHtml and someHtmlTag.innerText properties, these allow u do dynamicly change the content of an existing page. for example, if you have a DIV tag called "hello", using a javascript function u can alter its content - therefor "opening" the message the rest of the page will "resize" according to the new content. but first of all you have to dump the array the a javascript array, which is not realy a problem.
 

coolel

New member
But

if you keep the info in an array why not writing it on the page and just hiding it all and just show the selected message? why using arrays?
 

theG

New member
להבנתי, מבלי לחקור את ה SOURCE CODE

של תפוז, האפקט הזה נעשה ב USER SIDE, כלומר במחשב של כל אחד מהמשתמשים, אמנם אין ככ קשר עם PHP (כי PHP זה SERVER SIDE, ולו זה היה מתבצע בעזרת PHP היה צורך לרענן את הדף או להשתמש ב DYNAMIC HTML ... לא מכיר ככ, אז יתקנו אותי המומחים) אבל אפשר לעשות את האפקט הזה ע"י שימוש ב >DIV< ובסטייל ונ JS .
 
למעלה