Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Location
    Littlehampton, West Sussex, England
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Collapsible text

    Hi there

    A while ago I was searching the web for suitable snippets of code for a web site that I was designing.

    On one site I cannot remember the URL I found a snippet of code that allows a text box to collapse. At the time I thought what a stupid idea who would want that.

    Now I can see a very good reason for putting it on the site and will eternally regret not downloading it at the time.

    I was wondering if anyone out there what site this little snippet is on. I cannot remember if it was Javascript or css as at the time I was searching for both.

    I you know where I can find this site then please send me a link to same.

    Thank you

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    This can be done in many ways like, automatic resize with content, drag and resize by mouse, one click expand/contract etc.

    You'd get plenty of example from google by a search like http://www.google.com/search?q=javas...xpand+textarea

    PS: Welcome to CF
    Last edited by abduraooft; 10-10-2008 at 11:08 AM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Could be of interest:
    Code:
    <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.pack.js"></script>
    <script type="text/javascript">
    $(document).ready(function()
    	{
    	$('#trig').click(function()
    		{
    		if(this.value.toLowerCase()=='expand')
    			{
    			$('#mytxt').animate({height:'300px'},1000);
    			this.value='Collapse';
    			}
    		else
    			{
    			$('#mytxt').animate({height:'22px'},1000);
    			this.value='Expand';
    			}
    		});
    	});
    </script>
    <input type="text" id="mytxt"><br><input type="button" value="Expand" style="margin-top:10px;" id="trig">
    Learn how to javascript at 02geek

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

  • #4
    New to the CF scene
    Join Date
    Oct 2008
    Location
    Littlehampton, West Sussex, England
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks I will try this when I get time.

    My main Computer has just failed so I am currently using my lap top and whereas I have an internet connection all my files for the site are on my main computer so I will be busy downloading files to my laptop for a while.


  •  

    Posting Permissions

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