Results 1 to 4 of 4

Thread: Font Chooser window

  1. #1
    Join Date
    May 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Font Chooser window

    Hi Folks,

    I want a Font chooser pop up window which should be displayed when we click on particular HTML button and return me chosen font with all parameters.

    Can anybody here please provide me a link where Can I get this?

    Thanks & Regards,
    Rahul.

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    You might find this code useful
    HTML Code:
    <input type="button" value="Run Script" onclick="rangFunc()">
    <div id="wrap">
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Proin massa. Nam vehicula. 
    Morbi velit nisi, mollis id, ultrices luctus, adipiscing sit amet, lectus. Nunc rhoncus 
    nisl ac enim. Maecenas vestibulum dolor ut velit. Maecenas condimentum pulvinar purus. 
    Pellentesque ac ipsum. Curabitur sodales, elit vel molestie hendrerit, elit odio rhoncus tellus, 
    </div>
    <script type="text/javascript">
    function rangFunc()
    {
    var color=prompt('What is your desired font color','black');
    var size=prompt('What is your desired font size (pt)','12');
    var type=prompt('What is your desired font family','Tahoma');
    var style=prompt('How about your font style (Italic, Bold, Normal)','Normal');
    var wrap=document.getElementById('wrap');
    wrap.style.color=color;
    wrap.style.fontSize=size+'pt';
    wrap.style.fontFamily=type;
    if(style.toLowerCase()=='italic')
    wrap.style.fontStyle='italic';
    if(style.toLowerCase()=='normal')
    wrap.style.fontWeight='normal';
    if(style.toLowerCase()=='bold')
    wrap.style.fontWeight='bold';
    }
    </script>
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    May 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Rangana
    Thanks a lot...

    Really thats help, but can you also provide site link where I can find such scripts ?
    also I want to show some good UI window on click of button where I can choose font and color at the same time will be able to watch preview for it.
    I'm going to start with this but any help in this will be really helpful.

    Again thanks a lot.

    Reagrds,
    Rahul

  4. #4
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Quote Originally Posted by rahulrborkar View Post
    Hi Rangana
    Thanks a lot...

    Really thats help, but can you also provide site link where I can find such scripts ?

    Again thanks a lot.

    Reagrds,
    Rahul
    That code came fresh from my mind basing on your requirement

    You might find this link useful
    http://www.ahfb2000.com/colors.html
    Last edited by rangana; 05-16-2008 at 05:40 AM. Reason: Found a good link
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •