שלום,
אני היום יביא לכם מדריך של ה- + שיש באתרים למי שמכיר?
שלוחצים + ואז איזשהו טקסט נפתח ולוחצים מינוס והוא מתמעזר?
אז הנה המדריך:
בשורה הראשונה הגדרנו פונקצייה חדשה בשם hide()קוד HTML:<BODY> <SCRIPT LANGUAGE="JavaScript"> <!-- function hide() { if (document.getElementById("what_to_show").style.display == "") { document.getElementById("buttons").innerHTML = "Show"; document.getElementById("what_to_show").style.display = "none"; } else { document.getElementById("buttons").innerHTML = "Hide"; document.getElementById("what_to_show").style.display = ""; } } //--> </SCRIPT> <table cellpadding="0" cellspacing="0" border="1" bordercolor="black"> <tr> <td width="300"><a href="#" onclick="hide()"><div id="buttons">Hide</div></a></td> </tr> <tr id="what_to_show"> <td width="300"> <p>Michael Joseph Jackson (August 29, 1958 – June 25, 2009),<br> known as the "King of Pop", was an African American musician and one of the<br> most commercially successful and influential entertainers of all time.<br> His unique contributions to music and dance,<br> along with a highly publicized personal life,<br> made him a prominent figure in popular culture for over four decades.</p></td> </tr> </table>
לאחר מכן, הצבנו תנאי ושאלנו אם התכונה display שנמצאת בתוך style באובייקט שהID שלו זה what_to_show מוגדרת כנראת
אז הוא ישנה את ה"כפתור" "הסתר" ל"הראה"
ויסתיר את השורה (בטבלה) שנמצא שם המידע.
ואם התנאי לא מתצבע (כלומר שהשורה כבר מוסתרת) אז הוא ישנה את הכפתור ל"הסתר" ויראה את השורה וחוזר חלילה.
זהו תוכלו לשנות את הפתורים לתמונות של + ו - וזהו... D:
בהצלחה לכולם!



ציטוט ההודעה

