My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
mbExtruder  
jquery.mb.extruder
Featured
Updated Dec 4, 2009 by matbi...@gmail.com

This is a jQuery component to build a sliding panel where you can load content or navigation structure via Ajax.

Demo page: http://pupunzi.com/#mb.components/mb.extruder/extruder.html

blog page: http://pupunzi.open-lab.com/mb-jquery-components/mb-extruder/

Dependencies:

  • jquery.hoverIntent.js
  • jquery.metaData.js

JS call:

      $("#extruderTop").buildMbExtruder({
          positionFixed:true,
          width:350,
          sensibility:800,
          position:"top",
          extruderOpacity:1,
          flapDim:100,
          textOrientation:"bt", // or "bt" (top-bottom or bottom-top)
          onExtOpen:function(){},
          onExtContentLoad:function(){},
          onExtClose:function(){},
          slideTimer:300
      });

HTML constructor:

on the page:

  <div id="extruderTop" class="{title:'Our network', url:'parts/extruderTop.html'}">
    <div class="content"></div>
  </div>

There are two ways to fill the extruder:

  • The first is inline content
  • in this case you can put your content inside the "content" DIV directly; in the case you have a menu structure with a sub level content, that content can only be inserted via ajax using {panel:'parts/your subcontent url', data:'DATA to bi passed in the request as json object or as query string'} as class of the root voice.
  • The second is via ajax
  • This way lets you define the content of the extruder in a separate file called via ajax; the URL of the file is specified in the extruder DIV class attribute as above: {url:'parts/extruderTop.html', data:to pass in the request as json object or as query string} Passing additional DATA you can manage dynamically the content to be shown building your own logic.

The title shown in the flap:

it's defined in the extruder DIV class attribute as above: {title:'Our network',...}. The component use my jquery.mb.flipV.js to manage the orientation of the text in the case of left panels.

part to be included as primary content (in a separate file or just inline):

<div class="text">[text with no actions managed by the component including images, embedded movies or whatever you want]</div>
<div class="voice {}"><a class="label" href="http://pupunzi.com">mb.ideas.home</a></div>
<div class="voice {panel:'parts/extr.components.html'}"><a class="label" href="http://pupunzi.com/#mb.components/components.html">mb.jquery.components</a></div>
<div class="voice {disabled:true}"><span class="label">mb.info (disabled)</span> </div>
...

In the primary conent, the one you can see opening the panel, you can display a list of lines with differen actions or just a content you define;
As you can see above, each line is defined by a DIV with class "voice" or "text" and has different action:

  • the first is simply a container of content (class="text" in the DIV TAG);
  • the second is a direct link to a specified url in the href (class="label" in the A TAG);
  • the third is a direct link to a specified url and has a sub panel which url is defined in the class attribute as "panel" (class="voice {panel:'parts/extr.components.html'}" in the DIV TAG);
  • the forth is a disabled voice ("class="voice {disabled:true}" in the DIV TAG);

secondary content file (must be in a separate file; it's invoked in the "panel" metadata setted to the root voice as above):

<div class="text">[text with no actions managed by the component including images, embedded movies or whatever you want]</div>
<div><a onclick="alert('mb.pdf.magazine');">mb.pdf.magazine</a></div>
<div><a onclick="alert('mb.video');" >mb.video</a></div>
<div><a onclick="alert('mb.more');" >mb.more</a></div>
...

Parameters:

  • width:350, (int) the width of the sliding panel
  • sensibility:800, (int) the time in milliseconds to wait befor the slider will open without a click event
  • position:"top", (string) to define if the slider is on the top or on the left of your page
  • extruderOpacity:1, (int) the opacity of the sliding panel once it's closed (doesn't work in IE)
  • flapDim: 100, (int) the width or height (depends on the extruder position) of the flap containing the title
  • textOrientation: "tb", or "bt" (string) the orientation of the text for titles in the left panel flaps
  • onExtOpen, onExtContentLoad, onExtClose: "function(){}", (function) collbacks function for each event
  • slideTimer: 300, (int) the time in milliseconds for the slide transition

Methods:

  • $.fn.disableExtruderVoice(): disable an extruder voice; the voice must have an ID.
  • $.fn.enableExtruderVoice(): enable an extruder voice; the voice must have an ID.
Comment by joeyigno...@gmail.com, Nov 30, 2009

so far this is a great plugin for jquery although the documentation could use some impovement in the the areas of the JSON abilities eg what properties in using json, how to call json from a web service in the plugin and some examples using json also does this plugin requiure the use of physical html files or will it understand html returned from a partialview call in asp.net mvc / web service etc which is important to me since i use this for security trimming my menu output if you ucan help me out with any if this it would be appreciated a great plugin deserves great documentation to make it easier to use and implement and the information about exactly what support it has for remote technologies is highly needed especially for someone fairly new to JS and jquery

Comment by teamnel...@gmail.com, Dec 7, 2009

i agree completely with joeyignorant, i have no clue about json/ajax. researching it now :/

Comment by voke...@gmail.com, Dec 17, 2009

Is this working if I insert an iframe between <div class="text"></div>?

I tried but is not working... Am I missing something?

Comment by antonio....@gmail.com, Jan 2, 2010

Doesn't work correctly with Apache Sling, fail all the ajax calls.

Comment by Ajumbled...@gmail.com, Jan 3, 2010

Looks nice i have to say but to be honest outside of the demo.zip can not actually make it work. Ill check back at some other point when you got more of the bugs worked out. Just for your info so you do not think that im mistaken. I tried to incorporate this into other jquery projects. Portability to other jquery or at least the ones im using just dont seem to fit.

Comment by Ajumbled...@gmail.com, Jan 5, 2010

actually got this too work at somepoint. The dependencies are very incorrect to get this too work.

Comment by khalifavi, Feb 12, 2010

Hello Matteo, i just found that when we load the mb.extruder with inline contents it won't change to hover state (css class), it just doesn't change the background with extruder_voiceHover.png. thank you.

regards, khalifavi

Comment by psh...@yahoo.com, Feb 19, 2010

Pretty cool. My question is can it use bgiframe? Unfortunately I need to use extruder over the top of an iframe. Extruder is working for me, but its hidden behind the content of the page. Thanks.


Sign in to add a comment
Powered by Google Project Hosting