הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 07-08-06, 20:48   # 1
Unknown
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
גיל: 37
הודעות: 189

Unknown לא מחובר  

בקשר לשאלה הראשונה:
קוד:
xxx.value.replace(REPLACEWHAT,REPLACE WITH);
בקשר לשניה:
קצת ארוך מקווה שתבין הכל:

קוד:
function is_ie() {
	if (navigator.appName == "Microsoft Internet Explorer")
		return true;
	else
		return false;
}
function text2color(text,c) {
	txtElement = document.forms.myform.text;
	if (is_ie()) {
		txtElement.focus();
		docSelection = document.selection;
		txtSelection = docSelection.createRange();
		if (txtSelection.text != "") {
			txtSelection.text = '<font color="'+c+'">'+txtSelection.text+'</font>';
		} else {
			txtElement.value = '<font color="'+c+'">'+txtElement.value+'</font>';
		}
	} else {
		txtElement.focus();
		docSelection = txtElement.value.substring(txtElement.selectionStart, txtElement.selectionEnd);
		if (docSelection != "") {
			var newValue = "";
			newValue += txtElement.value.substring(0, txtElement.selectionStart);
			newValue += '<font color="'+c+'">'+docSelection+'</font>';
			newValue += txtElement.value.substring(txtElement.selectionEnd, txtElement.value.length);
			txtElement.value = newValue;
		} else {
			txtElement.value = '<font color="'+c+'">'+txtElement.value+'</font>';
		}
	}
}
__________________
מתכנת מקצועי (ידוע גם כUnknownGod)
שנות נסיון רבות בפיתוח אתרים ואפליקציות WEB

Last edited by Unknown; 07-08-06 at 20:51..
  Reply With Quote
ישן 07-08-06, 21:03   # 2
amirs_5
הוסטסניון
 
amirs_5's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
מיקום: ת"א
גיל: 34
הודעות: 2,168
שלח הודעה באמצעות ICO אל amirs_5 Send a message via Skype™ to amirs_5

amirs_5 לא מחובר  

תודה:)

הראשון עזר לי השני גם עובד אבל לא ממש הבנתי..
הבנתי חצי , את הקטע של האחרי הבדיקה של הדפדפן לא הבנתי.. את זה:
HTML קוד:
		txtElement.focus();
		docSelection = document.selection;
		txtSelection = docSelection.createRange();
		if (txtSelection.text != "") {
			txtSelection.text = '<font color="'+c+'">'+txtSelection.text+'</font>';
		} else {
			txtElement.value = '<font color="'+c+'">'+text+'</font>';
		}
מישהו יכול להסביר לי את זה ..?
תודה
__________________
אימיל \ מסן : amirs91 [at] gmail.com
  Reply With Quote
השב

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 14:50.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ