JQuery Accordion Menu Widget - Version 3.0

Version Description

  • Added: Ability to add menus using shortcodes
Download this release

Release Info

Developer remix4
Plugin Icon wp plugin JQuery Accordion Menu Widget
Version 3.0
Comparing to
See all releases

Code changes from version 2.6 to 3.0

dcwp_jquery_accordion.php CHANGED
@@ -3,9 +3,9 @@
3
Plugin Name: jQuery Vertical Accordion Menu
4
Plugin URI: http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-vertical-accordion-menu-widget/
5
Tags: jquery, dropdown, menu, vertical accordion, animated, css, navigation, accordion
6
- Description: Creates a widget, which allows you to create vertical accordion menus from any Wordpress custom menu using jQuery. Features include - handles multiple levels, saved state using cookies and option of selecting "click" or "hover" events for triggering the menu.
7
Author: Lee Chestnutt
8
- Version: 2.6
9
Author URI: http://www.designchemical.com
10
*/
11
@@ -25,6 +25,8 @@ class dc_jqaccordion {
25
wp_enqueue_script( 'jqueryhoverintent', dc_jqaccordion::get_plugin_directory() . '/js/jquery.hoverIntent.minified.js', array('jquery') );
26
wp_enqueue_script( 'jquerycookie', dc_jqaccordion::get_plugin_directory() . '/js/jquery.cookie.js', array('jquery') );
27
wp_enqueue_script( 'dcjqaccordion', dc_jqaccordion::get_plugin_directory() . '/js/jquery.dcjqaccordion.2.8.js', array('jquery') );
28
}
29
add_action( 'wp_footer', array('dc_jqaccordion', 'footer') );
30
@@ -56,4 +58,63 @@ $dcjqaccordion = new dc_jqaccordion();
56
// Register the widget
57
add_action('widgets_init', create_function('', 'return register_widget("dc_jqaccordion_widget");'));
58
59
?>
3
Plugin Name: jQuery Vertical Accordion Menu
4
Plugin URI: http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-vertical-accordion-menu-widget/
5
Tags: jquery, dropdown, menu, vertical accordion, animated, css, navigation, accordion
6
+ Description: Creates vertical accordion menus from any Wordpress custom menu using jQuery. Add menus using either widgets or shortcodes. Features include - handles multiple levels, saved state using cookies and option of selecting "click" or "hover" events for triggering the menu.
7
Author: Lee Chestnutt
8
+ Version: 3.0
9
Author URI: http://www.designchemical.com
10
*/
11
25
wp_enqueue_script( 'jqueryhoverintent', dc_jqaccordion::get_plugin_directory() . '/js/jquery.hoverIntent.minified.js', array('jquery') );
26
wp_enqueue_script( 'jquerycookie', dc_jqaccordion::get_plugin_directory() . '/js/jquery.cookie.js', array('jquery') );
27
wp_enqueue_script( 'dcjqaccordion', dc_jqaccordion::get_plugin_directory() . '/js/jquery.dcjqaccordion.2.8.js', array('jquery') );
28
+ // Shortcodes
29
+ add_shortcode( 'dcwp-jquery-accordion', 'dcwp_dc_jqaccordion_shortcode' );
30
}
31
add_action( 'wp_footer', array('dc_jqaccordion', 'footer') );
32
58
// Register the widget
59
add_action('widgets_init', create_function('', 'return register_widget("dc_jqaccordion_widget");'));
60
61
+ /**
62
+ * Create a menu shortcode
63
+ */
64
+ function dcwp_dc_jqaccordion_shortcode($atts){
65
+
66
+ extract(shortcode_atts( array(
67
+ 'menu' => '',
68
+ 'event' => 'click',
69
+ 'auto_close' => 'false',
70
+ 'save' => 'false',
71
+ 'expand' => 'false',
72
+ 'disable' => 'false',
73
+ 'close' => 'false',
74
+ 'count' => 'false',
75
+ 'menu_class' => 'menu',
76
+ 'disable_class' => '',
77
+ 'expand_class' => 'current-menu-item',
78
+ 'hover' => '600',
79
+ 'animation' => 'slow',
80
+ 'skin' => 'No Theme',
81
+ 'id' => ''
82
+ ), $atts));
83
+
84
+ $_SESSION['dc_jqaccordion_menu'] = $_SESSION['dc_jqaccordion_menu'] != '' ? $_SESSION['dc_jqaccordion_menu'] + 1 : 1 ;
85
+ $id = $id == '' ? 's'.$_SESSION['dc_jqaccordion_menu'] : 's'.$id ;
86
+ $menuId = 'dc_jqaccordion_widget-'.$id.'-item';
87
+
88
+ if($skin != 'No Theme'){
89
+ echo "\n\t<link rel=\"stylesheet\" href=\"".dc_jqaccordion::get_plugin_directory()."/skin.php?widget_id=".$id."&amp;skin=".strtolower($skin)."\" type=\"text/css\" media=\"screen\" />";
90
+ }
91
+
92
+ echo '<script type="text/javascript">
93
+ jQuery(document).ready(function($) {
94
+ jQuery("#'.$menuId.'").dcAccordion({
95
+ eventType: "'.$event.'",
96
+ hoverDelay: '.$hover.',
97
+ menuClose: '.$close.',
98
+ autoClose: '.$auto_close.',
99
+ saveState: '.$save.',
100
+ autoExpand: '.$expand.',
101
+ classExpand: "'.$expand_class.'",
102
+ classDisable: "'.$disable_class.'",
103
+ showCount: '.$count.',
104
+ disableLink: '.$disable.',
105
+ cookie: "'.$menuId.'",
106
+ speed: "'.$animation.'"
107
+ });
108
+ });
109
+ </script>';
110
+ echo '<div class="dcjq-accordion" id="'.$menuId.'">';
111
+ echo wp_nav_menu(
112
+ array(
113
+ 'fallback_cb' => '',
114
+ 'menu' => $menu,
115
+ 'menu_class' => $menu_class
116
+ )
117
+ );
118
+ echo '</div>';
119
+ }
120
?>
dcwp_jquery_accordion_widget.php CHANGED
@@ -245,7 +245,7 @@ class dc_jqaccordion_widget extends WP_Widget {
245
$skin = $wpdcjqaccordion['skin'];
246
$skin = htmlspecialchars(ucfirst(preg_replace('/\..*#x2F;', '', $skin)));
247
if($skin != 'No-theme'){
248
- echo "\n\t<link rel=\"stylesheet\" href=\"".dc_jqaccordion::get_plugin_directory()."/skin.php?widget_id=".$key."&skin=".strtolower($skin)."\" type=\"text/css\" media=\"screen\" />";
249
}
250
}
251
}
245
$skin = $wpdcjqaccordion['skin'];
246
$skin = htmlspecialchars(ucfirst(preg_replace('/\..*#x2F;', '', $skin)));
247
if($skin != 'No-theme'){
248
+ echo "\n\t<link rel=\"stylesheet\" href=\"".dc_jqaccordion::get_plugin_directory()."/skin.php?widget_id=".$key."&amp;skin=".strtolower($skin)."\" type=\"text/css\" media=\"screen\" />";
249
}
250
}
251
}
readme.txt CHANGED
@@ -4,17 +4,19 @@ Donate link: http://www.designchemical.com/blog/index.php/wordpress-plugins/word
4
Tags: jquery, dropdown, menu, vertical accordion, animated, css, navigation, widget
5
Requires at least: 3.0
6
Tested up to: 3.13
7
- Stable tag: 2.6
8
9
- Creates a widget, which allows you to create vertical accordion menus from any Wordpress custom menu using jQuery.
10
11
== Description ==
12
13
- Creates a widget, which allows you to create vertical accordion menus from any Wordpress custom menu using jQuery. Features include - handles multiple levels, saved state using cookies, add count of number of links and option of selecting "click" or "hover" events for triggering the menu. Uses the jquery cookie plugin by [Klaus Hartl](http://www.stilbuero.de).
14
15
- = Menu Options =
16
17
- The widget has several parameters that can be configured to help cutomise the vertical accordion menu:
18
19
* Click/Hover - Selects the event type that will trigger the menu to open/close
20
* Auto-close open menus - If checked this will allow only one menu item to be expanded at any time. Clicking on a new menu item will automatically close the previous one.
@@ -31,8 +33,31 @@ The widget has several parameters that can be configured to help cutomise the ve
31
32
Note: care should be taken when selecting the hover event as this may impact useability - adding a hover delay and reducing the animation speed may help reduce problems with useability
33
34
- [__See Demo__](http://www.designchemical.com/lab/demo-wordpress-vertical-accordion-menu-plugin/)
35
[__Plugin Home Page__](http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-vertical-accordion-menu-widget/)
36
37
== Installation ==
38
@@ -61,6 +86,9 @@ Another likely cause is due to other non-functioning plugins, which may have err
61
62
== Changelog ==
63
64
= 2.6 =
65
* Added: Ability to disable parent menu items using a CSS class
66
* Added: Ability to set menu CSS Class - default "menu"
4
Tags: jquery, dropdown, menu, vertical accordion, animated, css, navigation, widget
5
Requires at least: 3.0
6
Tested up to: 3.13
7
+ Stable tag: 3.0
8
9
+ Creates vertical accordion menus from any Wordpress custom menu using jQuery. Add menus using either widgets or shortcodes.
10
11
== Description ==
12
13
+ Creates vertical accordion menus from any Wordpress custom menu using jQuery. Add menus using either widgets or shortcodes. Features include - handles multiple levels, saved state using cookies, add count of number of links and option of selecting "click" or "hover" events for triggering the menu.
14
15
+ The plugin has several parameters that can be configured to help cutomise the vertical accordion menu. These can either be set via the widget control panel or by passing parameters in a shortcode:
16
17
+ = Widget Options for Menu =
18
+
19
+ The plugin has several parameters that can be configured to cutomise the vertical accordion menu:
20
21
* Click/Hover - Selects the event type that will trigger the menu to open/close
22
* Auto-close open menus - If checked this will allow only one menu item to be expanded at any time. Clicking on a new menu item will automatically close the previous one.
33
34
Note: care should be taken when selecting the hover event as this may impact useability - adding a hover delay and reducing the animation speed may help reduce problems with useability
35
36
+ = Using Shortcodes =
37
+
38
+ The minimum requirement to use a shortcode is to include the name of the menu that you want to use for the accordion - the name must match one of the menus created in the Wordpress menu admin page. To add a menu using shortcodes use the following code:
39
+
40
+ [dcwp-jquery-accordion menu="Test Menu"]
41
+
42
+ Optional shortcode parameters for customising the menu (refer to widget settings above for information):
43
+
44
+ event - click/hover (default = click)
45
+ auto_close - true/false (default = false)
46
+ save - true/false (default = false)
47
+ expand - true/false (default = false)
48
+ disable - true/false (default = false)
49
+ close - true/false (default = false)
50
+ count - true/false (default = false)
51
+ menu_class - optional (default = menu)
52
+ disable_class - optional (no default)
53
+ hover - 600
54
+ animation - slow/normal/fast (default = slow)
55
+ skin - black/blue/clean/demo/graphite/grey (default = No Theme)
56
+
57
+ For more information please check out the plugin home page:
58
+
59
[__Plugin Home Page__](http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-vertical-accordion-menu-widget/)
60
+ [__See Demo__](http://www.designchemical.com/lab/demo-wordpress-vertical-accordion-menu-plugin/)
61
62
== Installation ==
63
86
87
== Changelog ==
88
89
+ = 3.0 =
90
+ * Added: Ability to add menus using shortcodes
91
+
92
= 2.6 =
93
* Added: Ability to disable parent menu items using a CSS class
94
* Added: Ability to set menu CSS Class - default "menu"
skins/black.css CHANGED
@@ -1,5 +1,5 @@
1
#dc_jqaccordion_widget-%ID%-item{font: bold 13px Arial, sans-serif;}
2
- #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul li {margin: 0; padding: 0; border: none;}
3
#dc_jqaccordion_widget-%ID%-item ul a {padding: 10px 10px 10px 28px; background: #000 url(skins/images/bg_graphite.png) repeat-x 0 0; text-decoration:none; display: block; color: #fff; font-weight: normal;border-bottom: 1px solid #fff;}
4
#dc_jqaccordion_widget-%ID%-item ul ul a {background: #343434;}
5
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent, #dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent:hover {background: #000 url(skins/images/graphite_arrow_right.png) no-repeat 0 0; font-weight: bold; color: #fff;}
1
#dc_jqaccordion_widget-%ID%-item{font: bold 13px Arial, sans-serif;}
2
+ #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul li {margin: 0; padding: 0; border: none; list-style: none;}
3
#dc_jqaccordion_widget-%ID%-item ul a {padding: 10px 10px 10px 28px; background: #000 url(skins/images/bg_graphite.png) repeat-x 0 0; text-decoration:none; display: block; color: #fff; font-weight: normal;border-bottom: 1px solid #fff;}
4
#dc_jqaccordion_widget-%ID%-item ul ul a {background: #343434;}
5
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent, #dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent:hover {background: #000 url(skins/images/graphite_arrow_right.png) no-repeat 0 0; font-weight: bold; color: #fff;}
skins/blue.css CHANGED
@@ -1,5 +1,5 @@
1
#dc_jqaccordion_widget-%ID%-item{ border-top: 1px solid #013d6c; border-right: 1px solid #013d6c; border-left: 1px solid #013d6c;}
2
- #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul li {margin: 0; padding: 0; border: none;}
3
#dc_jqaccordion_widget-%ID%-item ul a {padding: 10px 10px 10px 15px; background: #0D5995; text-decoration:none; display: block; color: #fff; border-bottom: 1px solid #013d6c; border-top: 1px solid #4695d3;}
4
#dc_jqaccordion_widget-%ID%-item ul ul a {padding: 10px 10px 10px 25px;}
5
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent, #dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent:hover {padding: 10px 10px 10px 15px;}
1
#dc_jqaccordion_widget-%ID%-item{ border-top: 1px solid #013d6c; border-right: 1px solid #013d6c; border-left: 1px solid #013d6c;}
2
+ #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul li {margin: 0; padding: 0; border: none; list-style: none;}
3
#dc_jqaccordion_widget-%ID%-item ul a {padding: 10px 10px 10px 15px; background: #0D5995; text-decoration:none; display: block; color: #fff; border-bottom: 1px solid #013d6c; border-top: 1px solid #4695d3;}
4
#dc_jqaccordion_widget-%ID%-item ul ul a {padding: 10px 10px 10px 25px;}
5
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent, #dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent:hover {padding: 10px 10px 10px 15px;}
skins/clean.css CHANGED
@@ -1,5 +1,5 @@
1
#dc_jqaccordion_widget-%ID%-item{border-top: 1px solid #cfcfcf; border-right: 1px solid #cfcfcf; border-left: 1px solid #cfcfcf;}
2
- #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul li {margin: 0; padding: 0; border: none;}
3
#dc_jqaccordion_widget-%ID%-item ul a {padding: 10px 15px; background: #fff url(skins/images/bg_clean.png) repeat-x top center; font-weight: bold; text-transform: uppercase; text-decoration:none; display: block; color: #222; border-bottom: 1px solid #cfcfcf;}
4
#dc_jqaccordion_widget-%ID%-item ul ul a {padding: 10px 10px 10px 25px; background: #fff; font-weight: normal; text-transform: capitalize;}
5
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent {padding: 10px 15px; background: #efefef url(skins/images/bg_clean.png) repeat-x top center; font-weight: bold; text-transform: uppercase;}
1
#dc_jqaccordion_widget-%ID%-item{border-top: 1px solid #cfcfcf; border-right: 1px solid #cfcfcf; border-left: 1px solid #cfcfcf;}
2
+ #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul li {margin: 0; padding: 0; border: none; list-style: none;}
3
#dc_jqaccordion_widget-%ID%-item ul a {padding: 10px 15px; background: #fff url(skins/images/bg_clean.png) repeat-x top center; font-weight: bold; text-transform: uppercase; text-decoration:none; display: block; color: #222; border-bottom: 1px solid #cfcfcf;}
4
#dc_jqaccordion_widget-%ID%-item ul ul a {padding: 10px 10px 10px 25px; background: #fff; font-weight: normal; text-transform: capitalize;}
5
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent {padding: 10px 15px; background: #efefef url(skins/images/bg_clean.png) repeat-x top center; font-weight: bold; text-transform: uppercase;}
skins/demo.css CHANGED
@@ -1,5 +1,5 @@
1
#dc_jqaccordion_widget-%ID%-item{background-color: #fff; border-top: 1px solid #ccc; border-right: 1px solid #ccc; border-left: 1px solid #ccc;}
2
- #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul li {margin: 0; padding: 0; border: none;}
3
#dc_jqaccordion_widget-%ID%-item ul a {background-repeat: no-repeat; background-position: 10px center; border-top: 1px solid #fff; border-bottom: 1px solid #ccc; padding: 10px 10px 10px 32px; text-decoration:none; display: block; color: #222; font-weight: bold;}
4
#dc_jqaccordion_widget-%ID%-item ul ul a {font-weight: normal;}
5
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent {background-image: url(skins/images/plus_grey.png); font-weight: bold; background-color: #fff;}
1
#dc_jqaccordion_widget-%ID%-item{background-color: #fff; border-top: 1px solid #ccc; border-right: 1px solid #ccc; border-left: 1px solid #ccc;}
2
+ #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul li {margin: 0; padding: 0; border: none; list-style: none;}
3
#dc_jqaccordion_widget-%ID%-item ul a {background-repeat: no-repeat; background-position: 10px center; border-top: 1px solid #fff; border-bottom: 1px solid #ccc; padding: 10px 10px 10px 32px; text-decoration:none; display: block; color: #222; font-weight: bold;}
4
#dc_jqaccordion_widget-%ID%-item ul ul a {font-weight: normal;}
5
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent {background-image: url(skins/images/plus_grey.png); font-weight: bold; background-color: #fff;}
skins/graphite.css CHANGED
@@ -1,5 +1,5 @@
1
#dc_jqaccordion_widget-%ID%-item{font: bold 14px Arial, sans-serif; border-top: 1px solid #111; border-right: 1px solid #111; border-left: 1px solid #111;}
2
- #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul li {margin: 0; padding: 0; border: none;}
3
#dc_jqaccordion_widget-%ID%-item ul a {padding: 10px 10px 10px 50px; background: #0C0C0C url(skins/images/bg_black.png) repeat-x 0 -1px; text-decoration:none; display: block; color: #ddd; border-bottom: 1px solid #222; border-top: 1px solid #777; position: relative;}
4
#dc_jqaccordion_widget-%ID%-item ul ul a {background: #424549;}
5
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent, #dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent:hover {background: #0C0C0C url(skins/images/bg_black.png) repeat-x 0 -1px;}
1
#dc_jqaccordion_widget-%ID%-item{font: bold 14px Arial, sans-serif; border-top: 1px solid #111; border-right: 1px solid #111; border-left: 1px solid #111;}
2
+ #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul li {margin: 0; padding: 0; border: none; list-style: none;}
3
#dc_jqaccordion_widget-%ID%-item ul a {padding: 10px 10px 10px 50px; background: #0C0C0C url(skins/images/bg_black.png) repeat-x 0 -1px; text-decoration:none; display: block; color: #ddd; border-bottom: 1px solid #222; border-top: 1px solid #777; position: relative;}
4
#dc_jqaccordion_widget-%ID%-item ul ul a {background: #424549;}
5
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent, #dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent:hover {background: #0C0C0C url(skins/images/bg_black.png) repeat-x 0 -1px;}
skins/grey.css CHANGED
@@ -1,5 +1,5 @@
1
#dc_jqaccordion_widget-%ID%-item{font: bold 14px Arial, sans-serif; border-top: 1px solid #ccc; border-right: 1px solid #ccc; border-left: 1px solid #ccc;}
2
- #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul li {margin: 0; padding: 0; border: none;}
3
#dc_jqaccordion_widget-%ID%-item ul a {padding: 10px 10px 10px 50px; background: #ececec; text-decoration:none; display: block; color: #333; border-bottom: 1px solid #ccc; border-top: 1px solid #fff; position: relative; text-shadow: 1px 1px 1px #fff;}
4
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent, #dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent:hover {background: #D7D4D4 url(skins/images/bg_grey.png) repeat-x 0 -1px;}
5
#dc_jqaccordion_widget-%ID%-item ul a .dcjq-icon {position: absolute; top: 50%; left: 14px; width: 34px; margin-top: -17px; height: 34px; background: url(skins/images/arrow_grey_right.png) no-repeat 0 center;}
1
#dc_jqaccordion_widget-%ID%-item{font: bold 14px Arial, sans-serif; border-top: 1px solid #ccc; border-right: 1px solid #ccc; border-left: 1px solid #ccc;}
2
+ #dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul li {margin: 0; padding: 0; border: none; list-style: none;}
3
#dc_jqaccordion_widget-%ID%-item ul a {padding: 10px 10px 10px 50px; background: #ececec; text-decoration:none; display: block; color: #333; border-bottom: 1px solid #ccc; border-top: 1px solid #fff; position: relative; text-shadow: 1px 1px 1px #fff;}
4
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent, #dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent:hover {background: #D7D4D4 url(skins/images/bg_grey.png) repeat-x 0 -1px;}
5
#dc_jqaccordion_widget-%ID%-item ul a .dcjq-icon {position: absolute; top: 50%; left: 14px; width: 34px; margin-top: -17px; height: 34px; background: url(skins/images/arrow_grey_right.png) no-repeat 0 center;}