JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 5th, 2013, 11:08 PM
gayathri.G gayathri.G is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 24 gayathri.G User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 29 m 22 sec
Reputation Power: 0
drop down menu

Hi,
Please help me for making a dropdown menu for font size,font name and to make a color palatte in javascript.

Reply With Quote
  #2  
Old March 5th, 2013, 11:54 PM
gayathri.G gayathri.G is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 24 gayathri.G User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 29 m 22 sec
Reputation Power: 0
Sorry i cann't understand yukti023

Reply With Quote
  #3  
Old March 6th, 2013, 12:08 AM
gayathri.G gayathri.G is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 24 gayathri.G User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 29 m 22 sec
Reputation Power: 0
Quote:
Originally Posted by yukti023
what is SEO and give the topic of on page

No idea about the SEO.

Reply With Quote
  #4  
Old March 6th, 2013, 04:55 AM
gayathri.G gayathri.G is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 24 gayathri.G User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 29 m 22 sec
Reputation Power: 0
Code:
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.

Reply With Quote
  #5  
Old March 6th, 2013, 11:22 PM
gayathri.G gayathri.G is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 24 gayathri.G User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 29 m 22 sec
Reputation Power: 0
Code:
<script type="text/javascript">
function formatText(el,tag){
var selectedText = document.selection?document.selection.createRange().text:el.value.substring(el.selectionStart,el.sel  ectionEnd);
if(selectedText!=''){
var newText='<'+tag+'>'+selectedText+'</'+tag+'>';
el.value=el.value.replace(selectedText,newText)
}
} 
</script>
</head>
<body>
<form action="" id="myForm">
<textarea name="myTextarea" rows="12" cols="50">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</textarea><br>
<textarea name="mytextarea2" rows="10" cols="50">His is my second textarea and I want the below buttons work for it as well.</textarea><br>
<input type="button" value="Bold" onclick="formatText(myTextarea,'b')">
<input type="button" value="Italic" onclick="formatText(myTextarea,'i')">
<input type="button" value="Underline" onclick="formatText(myTextarea,'u')">

The above code is to put the selected text inbetween the tags.Like this i want to do for font size. Is it possible to do.If so please tell me how to do.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > drop down menu

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap