Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > CSS > CSS Cascading Style Sheets
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 25th, 2013, 11:57 PM
Registered User
 
Join Date: Jun 2013
Posts: 2
Thanks: 0
Thanked 2 Times in 2 Posts
Default web form that can expand or collapse

I am new and with a new issue. Can I create a web form that can expand or collapsible on click with html and css? If not, how can I achieve this?
The Following User Says Thank You to fran6dkw For This Useful Post:
 
Old July 5th, 2013, 03:49 AM
Registered User
 
Join Date: Jul 2013
Posts: 11
Thanks: 0
Thanked 1 Time in 1 Post
Default

CSS not have event click, just hover event. You can use javascript for event click.
 
Old July 5th, 2013, 06:38 AM
Registered User
 
Join Date: Jun 2013
Posts: 2
Thanks: 0
Thanked 2 Times in 2 Posts
Default CSS form issue

Thanks for the response. But since css does not support click, but only hover, I need to click for the form to be steady, and another click for the form to disappear.
What JavaScript code can then solve the issue for me?
The Following User Says Thank You to fran6dkw For This Useful Post:
 
Old July 6th, 2013, 02:39 AM
Registered User
 
Join Date: Jul 2013
Posts: 11
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can use jQuery toggle: http://api.jquery.com/toggle/

HTML Code:
<div id="content"></div>
<div id="button"></div>
<script type="text/javascript">
$('#button').toggle(
function(){
$('#content').hide();
},
function(){
$('#content').show();
}
);
</script>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Treeview Expand/Collapse Behavior Colonel Angus ASP.NET 2.0 Professional 0 February 9th, 2009 11:17 AM
Expand/Collapse Structure kanoorani Javascript 4 June 19th, 2007 03:54 AM
Colla[se and expand form sangeenobs Beginning VB 6 1 March 22nd, 2006 07:11 PM
Expand/Collapse Data rafstar Classic ASP Basics 4 June 8th, 2003 10:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.