How to tabbed content widget for Blogger

 

| 83 comments
blogger tabbed contents
Tabbed content box or tab view is a great way to maximize the usage of precious screen real estate on your blog.
There are quite a few tutorials out there that show how to create tabs with CSS and jQuery. However, most of them require you to modify your blog template codes. On top of that you also have to manually add the content of each tab.
Fortunately, with this tutorial you don't have to go to all that troubles. All you have to do is add our tabber code into a HTML/Javascript widget. Once added, it will transform your Blogger blog's existing widgets into tabs, automatically!
See the demo here.
Below are some of the features of the tab content box:
  1. Accommodates unlimited number of widgets.
  2. Keeps the tabbed widgets' original appearance.
  3. Fully widgetized for ease of installation and removal. If you don't like what it does, simply remove the HTML/Javascript gadget.  

Installation

  1. Go to Design > Page Elements and click Add A Gadget.
  2. Select HTML/Javascript widget.
  3. Leave the title box blank.
  4. Copy the code below and paste it inside the content box.
    01 <style type="text/css">
    02 .tabber {
    03  padding: 0px !important;
    04  border: 0 solid #bbb;
    05 }
    06 .tabber h2 {
    07  float: left;
    08  margin: 0 1px 0 0;
    09  font-size: 12px;
    10  padding: 3px 5px;
    11  border: 1px solid #bbb;
    12  margin-bottom: -1px; /*--Pull tab down 1px--*/
    13  overflow: hidden;
    14  position: relative;
    15  background: #e0e0e0;
    16  cursor:pointer;
    17  -moz-border-radius:5px 5px 0 0;
    18  border-radius:5px 5px 0 0;
    19 }
    20 html .tabber h2.active {
    21  background: #fff;
    22  border-bottom: 1px solid #fff; /*--"Connect" active tab to its content--*/
    23 }
    24 .tabber .widget-content {
    25  border: 1px solid #bbb;
    26  padding: 10px;
    27  background: #fff;
    28  clear:both;
    29  margin:0;
    30 }
    31 .codewidget, #codeholder {
    32  display:none;
    33 }
    34 </style>
    35   
    36 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
    37 <script type="text/javascript" src="http://greenlava-code.googlecode.com/svn/trunk/publicscripts/bloggertabs0.1_min.js"></script>
    38 <script type="text/javascript">
    39 $(document).ready(function() {
    40  $('#codeholder').bloggerTabber ({
    41   tabCount : 3
    42  });
    43 });
    44 </script>
    45   
    46 <!-- to make sure the widget works, do not alter the code below -->
    47 <div id='codeholder'><p>Get this <a href="http://www.bloggersentral.com/2011/05/create-tabbed-content-blogger-widgets.html" target="_blank">widget</a></p></div>
    • Code line 36 is for loading jQuery library. Remove this line if you've already loaded it somewhere else in your blog. Hint: If your blog has a slider, cycler or something with fading effect running, chances are it is powered by jQuery.
    • Specify the number of widgets that you want to turn into tabs in line 41.
    • The default box background color is white (#fff). You can change it in code line 27. Apply the same color for the active tab's background and bottom border (in line 21 and 22).
  5. Position the HTML/Javascript gadget above the gadgets that you want to tabify.
     tabbed contents view elements
  6. Click Save and view your blog.

Post-installation

  • Make sure you title each widget that you want to tabify. Tabber won't work properly without widget titles.
  • Reduce tab widths so that all tabs fit into a single row. This can be achieved by using short widget titles.
  • You may need to reduce the widths of the tabified widgets to fit them into the box.
  • Don't forget to test in Internet Explorer. This widget may cause "Operation aborted" error in IE for some non-designer templates. If that's the case, this widget is not for you :(


FOLLOW and JOIN to Get Update!

Social Media Widget SM Widgets




Demo Blog NJW V2 Updated at: 11:39 PM

0 Komen:

Post a Comment

Popular