Toggle Content with Links - - Great Space Saver and Just Plain Cool!
Original Code Users Pre-November 19, 2011 - After Ning updated the jQuery Lib, you need to update your code in Custom Code Box, for this tip. Search for: <!-- Toggle Content --> Replace entire block with:
ToggleContentCustomCodeBox_without_jscall.txt
http://jensocial.com/group/ningnetworktips
This is the type of step-by-step instructions and quality of tip you will find in the Premium Group on JenSocial, and one of those I call: a Sweet Little Tip. I added this premium tip to the 100s of Free Tips on JenSocial, as a premium example. I thought you all would thoroughly enjoy this tip too.
This code isn't fancy. It's a clean and simple way to display links with toggled content. When a link is clicked, content is displayed below the link. It's a nice space saver, and just cool.
Unfortunately I can't install a Working Example on Creators. Go here for working example. This tip may look like a challenge, but no kidding, it is so easy. You have 3 easy steps. And the results are awesome.

Get Creative! ToggleContentTextBox_GetCreative.txt

Installation Overview: Edit the code for Text Box, adding as many links/content you need to add. Each DIV has an assigned class identifier for the header (toggle_head) and body content (toggle_body), and noted in example code. Wrap all of the code in one DIV with class="toggle_list". Edit the CSS by changing the width, header and body (text and background colors). Edit the Custom Code for the speed of the open/close action. Add your edited code to the appropriate boxes - - in notes.
Edit Code Below, Adding Your Content. Add Finished Code to Text Box. Be sure to click on the HTML button when adding your code.
Tip: If you want to add multiple expandable DIVs, you can force the width of each one, overriding the CSS, like this:
<div style="width: 600px!important;" class="toggle_list">
Edit CSS Below, and Add to Advanced CSS. See comments for changing width, background and font colors, for header and body.
ToggleContentCSS.txt
CSS with Green Plus Sign Image: ToggleContentCSS_withplus.txt
/* CSS for Toggle Content */
.toggle_list {
margin: 0px;
padding: 0px;
width: 467px; /* Width of Content Area */
}
.toggle_head {
padding: 5px 10px;
cursor: pointer;
position: relative;
background-color:#83D13D; /* Header Background Color. Remove for none. */
margin:1px;
color:#ffffff; /* Header Text Color */
}
.toggle_body {
padding: 5px 10px 15px;
background-color:#F2FFE1; /* Body Background Color. Remove for none. */
color:#333333; /* Body Text Color */
}
/* End CSS for Toggle Content */
Edit code below, and Add to your Custom Code Box.
ToggleContentCustomCodeBox_without_jscall.txt
<!-- Toggle Content -->
<script type="text/javascript">
//hide the all of the element with class toggle_body
x$(".toggle_body").hide();
//toggle the content with class toggle_body
x$(".toggle_head").click(function()
{
// 200 is good for fast, and 600 for slow open
x$(this).next(".toggle_body").slideToggle(200);
});
</script>
<!-- End Toggle Content -->
Enjoy! If you're a Ning Network Creator, join us on JenSocial in Jen's VIP Group. It's a great place to chat about all kinds of great topics, business and fun! Just ask any of our 100+ members. ;-)
Enjoy!
Tags: collapse, collapse DIV, expand, expand list, expanding collapsing, links that open, open close content, open close links, toggle, toggle content
Permalink Reply by Scott Bishop on July 28, 2011 at 9:39am Cool! Thanks for that. I did it slightly different...
I took your image url and pasted it to the <p class="toggle_head"> so it looks like this:
<p class="toggle_head"><img src="http://api.ning.com/files/hM9vYYr-9SE2sHOjYoZwkQWJBgei-ClIM5h2*QO14HDmAj8-1rqpf4MLJsvSjSeN2622KcyOEwBiyv5H4Jm*qXyLxM9cDltk/grnplus16.png" alt="Select Down">
Thanks again Jen!
You can view my finished product of your tip at: Surf Forecast Widgets
btw - I made the widgets off of kickapps.com

Nice Scott!
Permalink Reply by Gary LeMaster on July 28, 2011 at 9:44am This is really cool. I'm not a coder AT ALL, but having access to this stuff makes my life SOOO much easier.
I'm wondering - could this display results from a DB Query?

If you can add the DB Query to a text box with script or embedded code, you should be able to add to the Toggle code.
Best,
Jen

CRITICAL ANNOUNCEMENT:
A lot of Ning Networks are experiencing issues with jQuery conflicts after Ning updated their jQuery lib. Custom Code that calls in an extra jQuery lib file needs to be modified. For this tip do the following. IT IS CRITICAL THAT YOU MAKE THIS CHANGE:
Original Code Users Pre-November 19, 2011 - After Ning updated the jQuery Lib, you need to update your code in Custom Code Box, for this tip. Search for: <!-- Toggle Content --> Replace entire block with:
ToggleContentCustomCodeBox_without_jscall.txt
Permalink Reply by Scott Bishop on November 30, 2011 at 8:51pm Mine seems to be working fine. Should I replace it anyways?
See here: Surf Forecast Widgets

Yes. Intermittent errors are occurring with the jQuery conflicts. The most prevalent and recent issue is the edit profile photo/cropping tool will not work. Let me know if you experience any issues with my update.
Best,
Jen
Permalink Reply by Scott Bishop on November 30, 2011 at 9:05pm Done. Worky fine, last long time...

Great, and thanks for the update!
Permalink Reply by Groudswell on December 31, 2011 at 1:36pm What a great tip by Jen. I'm wondering if there is a way to use something besides a plus sign (check out http://www.deferolaw.com/Directory-of-Services-for-Law-Firms-and-La...) Also, how do you align this to the left?
Happy New Year!
I love this tip Jen!
The only issue I have is with Chrome.. the thing with how embedding iframes (youtube clips) in the widget causes the video to 'stick' to the top-left of page (until I click the toggle head for this feature). After some googling, i found this thread about the issue, but no solution.
You wouldnt happen to know how to embed a youtube clip without iframes, would you? OR, is there a way to work the widget around this Chrome glitch?


soaringeagle replied to soaringeagle's discussion 'stop confusing everyone make your 3.0 icons more use friendly'
Yaron replied to Allison Leahy's discussion 'Changes to Ning 3.0 Based on Your Feedback'
Apostle Solael replied to Allison Leahy's discussion 'Changes to Ning 3.0 Based on Your Feedback'
Kos replied to soaringeagle's discussion 'stop confusing everyone make your 3.0 icons more use friendly'
soaringeagle replied to soaringeagle's discussion 'stop confusing everyone make your 3.0 icons more use friendly'
Kos replied to soaringeagle's discussion 'stop confusing everyone make your 3.0 icons more use friendly'
Kos replied to Suzie Nielsen's discussion 'quick question'© 2013 Created by Ning.
