![]() |
קוד ב JAVESCRIPT
זה הקוד JS:
function showhide(id) { if (document.getElementById(id).style.display == "none") { document.getElementById(id).style.display = "inline" } else { document.getElementById(id).style.display = "none"; } } וזה חלק מה-HTML: <td><a href="#" onclick="javascript:showhide('picture1');">תמונה 1</a></td> <td><a href="#" onclick="javascript:showhide('picture2');">תמונה 2</a></td> <td><a href="#" onclick="javascript:showhide('picture3');">תמונה 3</a></td> <td><a href="#" onclick="javascript:showhide('picture4');">תמונה 4</a></td> <td><a href="#" onclick="javascript:showhide('picture5');">תמונה 5</a></td> מה שהקוד הזה עושה בתכלס שאם לוחצים על הקישור תמונה 1: זה מציג תמונה, אם קישור תמונה 2 זה מציג אותה מתחתיה, אם אני לוחץ עוד פעם על 1 זה מוחק את התמונה 1. אני רוצה שנגיד אני ילחץ 1 זה יציג לי את התמונה הראשונה, ונגיד אני ילחץ 2 זה יוריד תראשונה ויציג תתמונה השנייה, ז"א כל פעם תמונה אחרת שאני בוחר |
לפי סדר הלחיצות או לפי סדר התמונות?
|
לפי סדר התמונות
|
תעלה בבקשה קוד html מלא של העמוד שלך.
כמה שיותר מהר בבקשה |
<body>
<div id="main"> <div id="menu"> <ul> <?php include('blocks/menu.php'); ?> </ul> </div> <div id="bg"> <div id="banner-m"></div> <div id="text"> <p>גלריה</p> </div> <div id="paget"></div> <div id="page"> <table> <tr> <td><a href="#" onclick="javascript:showhide('picture1');">תמונה 1</a></td> <td><a href="#" onclick="javascript:showhide('picture2');">תמונה 2</a></td> <td><a href="#" onclick="javascript:showhide('picture3');">תמונה 3</a></td> <td><a href="#" onclick="javascript:showhide('picture4');">תמונה 4</a></td> <td><a href="#" onclick="javascript:showhide('picture5');">תמונה 5</a></td> </tr> </table> <br> <table cellpadding="9" cellspacing="6" class="table" align="center"> <tr> <td class="table" id="picture1" style="display:none;"><img src="http://www.introx-serv.co.il/img/1.png" border="0"></td> <td class="table" id="picture2" style="display:none;"><img src="http://www.introx-serv.co.il/img/2.png" border="0"></td> <td class="table" id="picture3" style="display:none;"><img src="http://www.introx-serv.co.il/img/3.png" border="0"></td> <td class="table" id="picture4" style="display:none;"><img src="http://www.introx-serv.co.il/img/4.png" border="0"></td> </tr> </table> </div> </div> </div> </div> </body> |
ציטוט:
אני מבין שעברית זאת שפה קשה. אנא ממך: העתק את כל הקובץ, כולל כל הדברים, html css js php וכו' וכו' וכו' ותדביק אותו בתוך תגיות code של פורום. תודה |
body:
ציטוט:
ציטוט:
|
בסוף הפונקציה תיצור משתנה שיכיל את האיידי שהועבר אליה,
בתחילת הפונקציה תבדוק אם המשתנה הזה קיים ואם כן תקבע עבור האלמנט עם האיידי הזה display none. |
ציטוט:
|
ציטוט:
אם אתה רוצה עזרה, תוכל לקבל עזרה ספציפית איך להתמודד עם מה שאתה צריך, אבל עליך להציג רצון ללמוד ולא רק עניין בקבלת הקוד העובד. כך ש... במה נתקעת? |
כל הזמנים הם GMT +2. הזמן כעת הוא 17:36. |
מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ