homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

How to set clicked Call to Action?

 11:55 am on May 30, 2012 (gmt 0)

I have defined button, but how to set clicked button with expanded/collapsed menu items? I like to expand UL and LI items using Jquery? Clicked button should expand menu items and collapse.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<style type="text/css">
#calltoactionarea .clickarea {
border-radius: 5px 5px 0 0;
#calltoactionarea .clickarea {
border-radius: 5px 5px 0 0;
.calltoaction {
border-radius: 5px 5px 5px 5px;
color: #000000;
cursor: pointer;
display: inline-block;
position: relative;
text-decoration: none;

<div class="#calltoactionarea calltoaction clickarea">Basic features</div>




 9:16 pm on May 30, 2012 (gmt 0)

I think it could be something like:


 8:08 am on May 31, 2012 (gmt 0)

There is nice example:

Maybe this is the best:

<script type="text/javascript">
$(document).ready(function() {
setTimeout(function() {

// Appear/Disappear
$('#menu4 > li > a.expanded + ul').show();
$('#menu4 > li > a').click(function() {
$(this).toggleClass('expanded').toggleClass('collapsed').parent().find('> ul').toggle();
$('#example4 .expand_all').click(function() {
$('#menu4 > li > a.collapsed').addClass('expanded').removeClass('collapsed').parent().find('> ul').show();
$('#example4 .collapse_all').click(function() {
$('#menu4 > li > a.expanded').addClass('collapsed').removeClass('expanded').parent().find('> ul').hide();
}, 250);

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved