Jump to content

gaya

Members
  • Posts

    101
  • Joined

  • Last visited

Everything posted by gaya

  1. gaya

    dropdown menu

    Thanks dsonesuk. Then please tell me whether what i understand was correct or not.As you said i removed the function getColor1().I gave an id for the pallete.gif image. <html><head><script type="text/javascript">function getColor1() { alert("hai"); var img = document.createElement("img"); img.src = "img/palette.gif"; //img.height = 75; //img.width = 113; //img.style.top=800; //img.style.right=100; document.body.appendChild(img);getColor(); }function getColor(block){alert("hai1");var s_url=block.href;var pColor=s_url.substr(s_url.indexOf("#"));document.getElementById("colorPalDemo").style.color=pColor;document.getElementById("clr").style.display=hidden;//getColor1();}</script></head><body><td> Statement1<font color="#0000FF">*</font> </td> <td><textarea name="ques1" id="ques1" cols="25" rows="5" style="width: 220px; height: 100px;"></textarea> </td><img src="img/supst.png" usemap="#color_pallete" onClick="getColor1();" /> <!-- <img src="img/palette.gif" id="clr" usemap="#color_pallete" />--><map name="color_pallete" id="color_pallete"> <area shape="rect" coords="7,7,31,30" href="#FF0000" onclick="getColor(this);" /> <area shape="rect" coords="35,7,59,30" href="#00FF00" onclick="getColor(this);" /> <area shape="rect" coords="63,7,87,31" href="#0000FF" onclick="getColor(this);" /> <area shape="rect" coords="92,7,115,31" href="#8B008B" onclick="getColor(this);" /> <area shape="rect" coords="7,33,30,58" href="#00FFFF" onclick="getColor(this);"/> <area shape="rect" coords="36,34,59,57" href="#006400" onclick="getColor(this);" /> <area shape="rect" coords="63,34,86,58" href="#6B8E23" onclick="getColor(this);" /> <area shape="rect" coords="92,35,115,57" href="#00FF7F" onclick="getColor(this);" /> <area shape="rect" coords="8,61,31,85" href="#32CD32" onclick="getColor(this);" /> <area shape="rect" coords="35,62,59,85" href="#7FFFD4" onclick="getColor(this);" /> <area shape="rect" coords="64,61,86,85" href="#7FFF00" onclick="getColor(this);" /> <area shape="rect" coords="92,61,115,85" href="#008B8B" onclick="getColor(this);" /> <area shape="rect" coords="91,88,115,111" href="#9932CC" onclick="getColor(this);" /> <area shape="rect" coords="64,88,87,111" href="#00BFFF" onclick="getColor(this);" /> <area shape="rect" coords="36,88,59,112" href="#1E90FF" onclick="getColor(this);" /> <area shape="rect" coords="8,88,30,111" href="#FF4500" onclick="getColor(this);" /> </map><span id="colorPalDemo"></span> </body></html> The code i have pasted is changed.But i don't know whether what i understand and changedis correct or not. If not please tell me where i have to change in my code.
  2. gaya

    dropdown menu

    <div>Really sorry to say.</div><div> </div><div> </div><div> </div><div>This line i cann't able to understand.Please explain me again.</div>
  3. gaya

    dropdown menu

    Thanks for the reply dsonesuk. I changed the .fontcolor to .color. Thanks justsomeguy, but i cann't able to understand what exactly you are saying. Please explain me a little more.
  4. gaya

    dropdown menu

    I included the image but it still doesn't works for me. Please tell me what i'm doing wrong here. <html><head><script type="text/javascript">function getColor1() { var img = document.createElement("img"); img.src = "img/palette.gif"; document.body.appendChild(img);//getColor(); }function getColor(block){var s_url=block.href;var pColor=s_url.substr(s_url.indexOf("#"));document.getElementById("colorPalDemo").style.fontColor=pColor;getColor1();}</script></head><body> <img src="img/supst.png" usemap="#color_pallete" onClick="getColor1();" /><map name="color_pallete" id="color_pallete"> <area shape="rect" coords="7,7,31,30" href="#FF0000" onclick="getColor(this);" /> <area shape="rect" coords="35,7,59,30" href="#00FF00" onclick="getColor(this);" /> <area shape="rect" coords="63,7,87,31" href="#0000FF" onclick="getColor(this);" /> <area shape="rect" coords="92,7,115,31" href="#8B008B" onclick="getColor(this);" /> <area shape="rect" coords="7,33,30,58" href="#00FFFF" onclick="getColor(this);"/> <area shape="rect" coords="36,34,59,57" href="#006400" onclick="getColor(this);" /> <area shape="rect" coords="63,34,86,58" href="#6B8E23" onclick="getColor(this);" /> <area shape="rect" coords="92,35,115,57" href="#00FF7F" onclick="getColor(this);" /> <area shape="rect" coords="8,61,31,85" href="#32CD32" onclick="getColor(this);" /> <area shape="rect" coords="35,62,59,85" href="#7FFFD4" onclick="getColor(this);" /> <area shape="rect" coords="64,61,86,85" href="#7FFF00" onclick="getColor(this);" /> <area shape="rect" coords="92,61,115,85" href="#008B8B" onclick="getColor(this);" /> <area shape="rect" coords="91,88,115,111" href="#9932CC" onclick="getColor(this);" /> <area shape="rect" coords="64,88,87,111" href="#00BFFF" onclick="getColor(this);" /> <area shape="rect" coords="36,88,59,112" href="#1E90FF" onclick="getColor(this);" /> <area shape="rect" coords="8,88,30,111" href="#FF4500" onclick="getColor(this);" /> </map><span id="colorPalDemo"></span> </body></html>
  5. gaya

    dropdown menu

    Ok thanks justsomeguy, I used the same palette.But now i want to do is by clicking some image i want to show the palette. Please tell me how to do that.
  6. gaya

    dropdown menu

    Sorry justsomeguy. I cann't able to understand what you are saying.Will you please explain me a bit more.Otherwise please tell me some sample code for doing the color palette.
  7. gaya

    dropdown menu

    I cann't able to understand how the above code's co-ordinates are find. If i'm adding #ff0000, then how will i find its coordinates.
  8. gaya

    dropdown menu

    <script type="text/javascript">function getColor(block){var s_url=block.href;var pColor=s_url.substr(s_url.indexOf("#"));document.getElementById("colorPalDemo").style.backgroundColor=pColor;document.getElementById("colorPalDemo").innerHTML=pColor;}</script><img src="http://www.digimantra.com/blog/wp-content/uploads/2009/06/palette.gif" usemap="#color_pallete" /><map name="color_pallete" id="color_pallete"> <area shape="rect" coords="7,7,31,30" href="#003300" onclick="getColor(this);" /> <area shape="rect" coords="35,7,59,30" href="#003366" onclick="getColor(this);" /> <area shape="rect" coords="63,7,87,31" href="#000080" onclick="getColor(this);" /> <area shape="rect" coords="92,7,115,31" href="#333399" onclick="getColor(this);" /> <area shape="rect" coords="7,33,30,58" href="#008000" onclick="getColor(this);"/> <area shape="rect" coords="36,34,59,57" href="#008080" onclick="getColor(this);" /> <area shape="rect" coords="63,34,86,58" href="#0000ff" onclick="getColor(this);" /> <area shape="rect" coords="92,35,115,57" href="#666699" onclick="getColor(this);" /> <area shape="rect" coords="8,61,31,85" href="#339966" onclick="getColor(this);" /> <area shape="rect" coords="35,62,59,85" href="#33cccc" onclick="getColor(this);" /> <area shape="rect" coords="64,61,86,85" href="#3366ff" onclick="getColor(this);" /> <area shape="rect" coords="92,61,115,85" href="#800080" onclick="getColor(this);" /> <area shape="rect" coords="91,88,115,111" href="#993366" onclick="getColor(this);" /> <area shape="rect" coords="64,88,87,111" href="#00ccff" onclick="getColor(this);" /> <area shape="rect" coords="36,88,59,112" href="#00ffff" onclick="getColor(this);" /> <area shape="rect" coords="8,88,30,111" href="#00ff00" onclick="getColor(this);" /> </map><span id="colorPalDemo" name="" class="" style="height:50px;width:50px;display:block;color:#ffffff;"></span> I googled and seen this code.But the thing want i want is this same as the above thing.I.e)<font size="3" name="times new roman" color="red">"w3schools.invisionzone.com"</font> by clicking the palette the corresponding color code red is included inside the tags.Please tell me how to do that. Also please tell me what the coords is and also please tell me, if i want to add more colors how i shall add.
  9. gaya

    dropdown menu

    Thanks for the help justsomeguy.I did it by using document.getElementById.Also please tell me Is it possible to create a color pallate.For example,when we are typing in the reply textarea the optons like bold,italic,font,size,also text color etc are seen above. Now i want to do that text color.Please tell me how to do that using javascript.
  10. gaya

    dropdown menu

    var x=["ques1","ques2"];function changeSize(size){for ( var t = 0; t <= x.length; ++t ){document.getElementById(x[t]).style.fontSize = size + "px";}}function font(elems,tag,size){var i=0, el, selectedText, newText;while(el=elems[i++]){selectedText=document.selection?document.selection.createRange().text:el.value.substring(el.selectionStart,el.selectionEnd);if(selectedText!=''){newText='<'+tag+' size='+size+'>'+selectedText+'</'+tag+'>'; if(document.selection){ document.selection.createRange().text=newText; return; } else{//Moz el.value=el.value.substring(0,el.selectionStart)+newText+el.value.substring(el.selectionEnd,el.value.length); }}}}<input type="button" value="Font" onclick="font ([ques1,ques2,opt1,opt2,opt3,opt4],'font',size);">Font size:<select name="sizeselect" onchange="changeSize(this.value)"><option value="select">select</option><option value="10">10</option><option value="13">13</option><option value="15">15</option><option value="17">17</option><option value="19">19</option><option value="21">21</option><option value="23">23</option><option value="50">50</option></select> I dont know what i am doing wrong here. when clicking the font button the font size shows in the tag is 20 even if i select the font value as 10. Please tell me what i am doing wrong here.
  11. gaya

    dropdown menu

    Yes. The above u have mentioned is that what i am trying to do. Please tell me how to do that.
  12. gaya

    dropdown menu

    Otherwise please tell me, is it possible to do the select box for font name and size also the color palatte and mathematical expressions.I'm entering a text like "Hi, Welcome to w3schools.invisionzone.com" in a textbox. Now what i want to do is, i want to select the size,name color of font from the select box and after selecting the values i'll select the entered text from textarea, for example "w3schools.invisionzone.com". After selecting all these if i click a font button all the selected values has to be viewed inside the font tag as<font size="3" name="times new roman" color="red">"w3schools.invisionzone.com"</font> in my textarea.How shall i do this.Please tell me.
  13. gaya

    dropdown menu

    The following is my code function font(elems,tag,size){var i=0, el, selectedText, newText;while(el=elems[i++]){selectedText=document.selection?document.selection.createRange().text:el.value.substring(el.selectionStart,el.selectionEnd);// IE:Mozif(selectedText!=''){newText='<'+tag+" size="+size+'>'+selectedText+'</'+tag+'>'; if(document.selection){//IE document.selection.createRange().text=newText; return;//prevents the double replacement } else{//Moz el.value=el.value.substring(0,el.selectionStart)+newText+el.value.substring(el.selectionEnd,el.value.length); }}}}Font size:<select name="sizeselect" onchange="font([ques1,ques2,opt1,opt2,opt3,opt4],'font',this.value)"><option value="select">select</option><option value="10">10</option><option value="13">13</option><option value="15">15</option><option value="17">17</option><option value="19">19</option><option value="21">21</option><option value="23">23</option><option value="50">50</option></select> I want to refresh the slelectbox value automatically when the value is selected for 1st textbox.How to do this.Please tell me.
  14. gaya

    dropdown menu

    Please tell me is it possible to do something like, after selecting the vslue from select box for selected text, it should be viewed in textarea as <font size="3">welcome</font>The welcome is my selected text.
  15. gaya

    dropdown menu

    function changeSize(size){for ( var t = 0; t <= x.length; ++t ){ // change div text font size. // document.getElementById("text").style.fontSize = size;document.getElementById(x[t]).style.fontSize = size + "px";}}function updateh1family() { var selector = document.getElementById('selectFontFamily'); var family = selector.options[selector.selectedIndex].value; var a1 = document.getElementById('a1') a1.style.fontFamily = family; }</script></head><body>Select size:<select name="sizeselect" onchange="changeSize(this.value)"><option value="10">10</option><option value="13">13</option><option value="15">15</option><option value="17">17</option><option value="19">19</option><option value="21">21</option><option value="23">23</option><option value="50">50</option></select><select id="selectFontFamily" name="selectFontFamily" onchange="updateh1family();"> <option> Serif </option> <option> Arial </option> <option> Sans-Serif </option> <option> Tahoma </option> <option> Verdana </option> <option> Lucida Sans Unicode </option> </select><!--<div id="text"> This is a font size changer using javascript .</div>--><textarea name="a1" id="a1" style="width: 200px; height: 100px;"></textarea><textarea name="ques1" id="ques1" style="width: 200px; height: 100px;"></textarea> The above is my code. Its working fine.Still having another problem.If i want to increase the size for anyone text area means how to do for that.Because now for all the textarea input the size is increasing.Also please tell me how to work with the above code for font name and also i want to know how to do the color palatte.For example in our word document button A will be there.By clicking the A the colour palatte is viewed and from that we can select the colour what we want.Please tell me how to do this. Else is there any other way for doing this. Please tell me.Also please tell me is it possible to do like,for example i'm entering a text as "welcome to w3schoolsforum". In this i just want to highlight the word w3schoolsforum alone.Is it possible to do.
  16. gaya

    dropdown menu

    Hi,Please help me for making a dropdown menu for font size,font name and to make a color palatte in javascript.
  17. Thanks Ingolme. The code you preferred is perfectly working and this is the thing what i want. But you selected it with specific id. If i'm having two textareas means how it is possible. Also please tell me, it should be viewed inbetween the font tag. And also please tell me for all other values whether the same function is used.
  18. The above links i'd viewed already.But i want to store them by creating a editor.<font>π</font><font>°</font>. Is it possible to create a editor instead of entering the values manually.Something like http://www.codecogs.com/latex/eqneditor.php
  19. Is it possible to desing the math editor with all special characters in it.
  20. Thanks for the reply Ingolme.Actually after clicking the button the corresponding values will be seen like <font>π</font> in my database.This is the value seen in database in the font tag π-π
  21. Hi,Please tell me how to include all mathematical expressions in a clipboard and when clicking the font button, the clipboard is to get open. After by selecting the expression,corresponding value is seen between the font tags. Is it possible to do.Please tell me.
  22. <button type="button" onclick="addtext();getfocus();">Subscript</button>function addtext() {var newtext = document.getElementById("ques1").value;newtext += prompt("enter the value",'<sub></sub>');document.getElementById("ques1").value = newtext;document.getElementById('ques1').focus();} The above is my code. I did it for one textarea. But if i'm having another textarea and i want to include the subscript in that textarea only, How can i do this.Please tell me.
  23. Hi,I want to do the button for subscript and superscript. For example now, when we r typing the question in this textarea, if we want to highlight the main text we r selecting the statement and we click the B for bold. Then our statement becomes like <b>.....</b> Like this i want to do for subscript and superscript. If i give X2 I want to do like X<sub>2</sub>. Please tell me how to do this.
  24. Hi,I'm having buttons inside a form, superscript,subscript mouseover and mouse out. Also having some textbox named question,statement,option1,option2,option3,option4. Now i need to give link to buttons with the textboxes. when entering a question or statement or option i like to use the superscript,subscript mouseover and mouse out by clicking the buttons. Please anyone tell me how to do this. By clicking the button the tags <sup></sup> like this for all other the tag is to get open.
  25. Thanks justsomeguy. I did it. But not by printing the keycodes. Actually in my above code i used the regular expression for entering only digit. So when i'm trying to delete the entered digit using backspace, it simply consider the backspace as seperate event. So the back space wont work in this code. if ((/^\d{1}/.test (val)))
×
×
  • Create New...