ערכתי לאחרונה בתאריך 28.10.06 בשעה 17:24 בברכה, MoonHunter
יש לי 3 פונקציות, אחת ראשית שקוראת ל2 פונקציות נוספות.
ניתן לראות כאן למה אני מתכוון:
http://www.mamboheb.com/sell/products/vanimal.php?C_ID=23
בכל שורה יש כפתור בשם "פתח" בצידו השמאלי של העמוד, אם תלחצו על פתח, יפתח לכם תת-עמוד, זה נעשה באמצעות פונקציה א', ההחלפה של המילה "פתח" ל"סגור" ולהפך נעשת באמצעות פונקציה ב',הבעיה היא עם פונקציה ג', הפונקציה אמורה לטעון לאוביקט מסויים קובץ CSS, זה לא מתבצע, אני אשמח אם מישהו יוכל לעזור לי עם הפונקציה האחרונה, הינה הפונקציות:
<script type="text/javascript"> var loadedobjects="" function openDivContent(obj,url,file) { var divHeight = "100px"; var xmlObj = createRequestObject(); if (document.getElementById(obj.id + "_div").innerHTML == "") //Check to see if the page have been allready loaded { xmlObj.open("GET",url,false); xmlObj.send(""); if (xmlObj.status == "200") { //Load the page and load 2 functions. document.getElementById(obj.id + "_div").style.height = divHeight; document.getElementById(obj.id + "_div").innerHTML = xmlObj.responseText; switchShow(obj); loadobcss(obj,file); } } else { //Just use the switch key word func. switchShow(obj); } }function switchShow(obj) { var textClosed = "פתח"; var textOpened = "סגור"; //Open the div content and switch the key word. if (document.getElementById(obj.id + "_div").style.display == "none") { document.getElementById(obj.id + "_div").style.display = "inline"; obj.innerHTML = textOpened; } else { //Close the div content and switch the key word. document.getElementById(obj.id + "_div").style.display = "none"; obj.innerHTML = textClosed; } } function loadobcss(obj,file){ if (!document.getElementById) return var fileref="" if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding fileref=document.createElement("link") fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", file); } if (fileref!=""){ document.getElementById(obj.id + "_div").appendChild(fileref) loadedobjects+=file+" " //Remember this object as being already added to page } } </script>
|
תודה לעוזרים