Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6848869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:55:16+00:00 2026-05-27T00:55:16+00:00

//# jQuery – Horizontal Accordion //# Version 2.00.00 Alpha 1 //# //# portalZINE(R) –

  • 0
//# jQuery - Horizontal Accordion
//# Version 2.00.00 Alpha 1
//#
//# portalZINE(R) - New Media Network
//# http://www.portalzine.de
//#
//# Alexander Graef
//# portalzine@gmail.com
//#
//# Copyright 2007-2009

(function($) {
    $.hrzAccordion = {


       setOnEvent: function(i, container, finalWidth, settings){
            $("#"+container+"Handle"+i).bind(settings.eventTrigger,function() {          

                        var status = $('[rel='+container+'ContainerSelected]').data('status');

                        if(status ==1 && settings.eventWaitForAnim === true){
                         return false;  
                        }

                        if( $("#"+container+"Handle"+i).attr("rel") != container+"HandleSelected"){

                          settings.eventAction;

                            $('[id*='+container+'Handle]').attr("rel","");                          

                            $('[id*='+container+'Handle]').attr("class",settings.handleClass);

                            $("#"+container+"Handle"+i).addClass(settings.handleClassSelected);


                            $("."+settings.contentWrapper).css({width: finalWidth+"px" });

                            switch(settings.closeOpenAnimation)
                            {
                            case 1:


                        if($('[rel='+container+'ContainerSelected]').get(0)  ){
                        $('[rel='+container+'ContainerSelected]').data('status',1);

                            //current_width = $('[rel='+container+'ContainerSelected]').width();

                            $('[rel='+container+'ContainerSelected]').animate({width: "0px",opacity:"0"}, { queue:true, duration:settings.closeSpeed ,easing:settings.closeEaseAction,complete: function(){ 

                            $('[rel='+container+'ContainerSelected]').data('status',0);                                                                                                                                                                         } ,step: function(now){
                                                                                                                                                                                                                                    width = $(this).width();

                            //new_width = finalWidth- (finalWidth  * (width/current_width));
                            new_width = finalWidth - width;
                            $('#'+container+'Content'+i).width(Math.ceil(new_width)).css("opacity","1");

                            }});

                        }else{
                            $('[rel='+container+'ContainerSelected]').data('status',1);

                            $('#'+container+'Content'+i).animate({width: finalWidth,opacity:"1"}, { queue:false, duration:settings.closeSpeed ,easing:settings.closeEaseAction,complete: function(){
                                                                                                                                                                                                      $('[rel='+container+'ContainerSelected]').data('status',0);   
                                                                                                                                                                                                      }});


                            }

                            break;
                            case 2:
                                $('[id*='+container+'Content]').css({width: "0px"});
                                $('#'+container+'Content'+i).animate({width: finalWidth+"px",opacity:"1"}, { queue:false, duration:settings.openSpeed ,easing:settings.openEaseAction, complete: 
 settings.completeAction                                                                                                                                                                                                                                    });                     

                            break;
                            }

                            $('[id*='+container+'Content]').attr("rel","");         
                            $("#"+container+"Handle"+i).attr("rel",container+"HandleSelected");
                            $("#"+container+"Content"+i).attr("rel",container+"ContainerSelected");                 


                        }

                    }); 
}
        };

    $.fn.extend({

        hrzAccordionLoop: function(options) {
            return this.each(function(a){  

                var container = $(this).attr("id") || $(this).attr("class");
                var elementCount = $('#'+container+' > li, .'+container+' > li').size();
                var settings = $(this).data('settings');

                variable_holder="interval"+container ;
                var i =0;
                var loopStatus  = "start";

                variable_holder = window.setInterval(function(){                            

                $("#"+container+"Handle"+i).trigger(settings.eventTrigger);

                if(loopStatus =="start"){
                        i = i + 1;
                    }else{
                        i = i-1;    
                    }

                    if(i==elementCount && loopStatus  == "start"){
                        loopStatus  = "end";
                        i=elementCount-1;

                    }

                    if(i==0 && loopStatus  == "end"){
                        loopStatus  = "start";
                        i=0;

                    }
                                                },settings.cycleInterval);


                });
            },
        hrzAccordion: function(options) {
            this.settings = {
            eventTrigger            : "click",
            containerClass          : "container",
            listItemClass           : "listItem",                   
            contentContainerClass   : "contentContainer",
            contentWrapper          : "contentWrapper",
            contentInnerWrapper     : "contentInnerWrapper",
            handleClass             : "handle",
            handleClassOver         : "handleOver",
            handleClassSelected     : "handleSelected",
            handlePosition          : "right",
            handlePositionArray     : "", // left,left,right,right,right
            closeEaseAction         : "swing",
            closeSpeed              : 500,
            openEaseAction          : "swing",
            openSpeed               : 500,
            openOnLoad              : 2,
            hashPrefix              : "tab",
            eventAction             : function(){
                                    //add your own extra clickAction function here
                                    },
            completeAction          : function(){
                                    //add your own onComplete function here
                                    },
            closeOpenAnimation      : 1,// 1 - open and close at the same time / 2- close all and than open next
            cycle                   : false, // not integrated yet, will allow to cycle through tabs by interval
            cycleInterval           : 10000,
            fixedWidth              : "",
            eventWaitForAnim        : true

        };

        if(options){
            $.extend(this.settings, options);
        }
            var settings = this.settings;



            return this.each(function(a){           

                var container = $(this).attr("id") || $(this).attr("class");            

                $(this).data('settings', settings);

                $(this).wrap("<div class='"+settings.containerClass+"'></div>");

                var elementCount = $('#'+container+' > li, .'+container+' > li').size();

                var containerWidth =  $("."+settings.containerClass).width();

                var handleWidth = $("."+settings.handleClass).css("width");

                handleWidth =  handleWidth.replace(/px/,"");
                var finalWidth;
                var handle;

                if(settings.fixedWidth){
                    finalWidth = settings.fixedWidth;
                }else{
                    finalWidth = containerWidth-(elementCount*handleWidth)-handleWidth;
                }

                $('#'+container+' > li, .'+container+' > li').each(function(i) {

                    $(this).attr('id', container+"ListItem"+i);
                    $(this).attr('class',settings.listItemClass);
                    $(this).html("<div class='"+settings.contentContainerClass+"' id='"+container+"Content"+i+"'>"
                                 +"<div class=\""+settings.contentWrapper+"\">"
                                 +"<div class=\""+settings.contentInnerWrapper+"\">"
                                 +$(this).html()
                                 +"</div></div></div>");

                    if($("div",this).hasClass(settings.handleClass)){

                    var html = $("div."+settings.handleClass,this).attr("id",""+container+"Handle"+i+"").html();
                    $("div."+settings.handleClass,this).remove();

                     handle = "<div class=\""+settings.handleClass+"\" id='"+container+"Handle"+i+"'>"+html+"</div>";
                    }else{
                     handle = "<div class=\""+settings.handleClass+"\" id='"+container+"Handle"+i+"'></div>";
                    }



                    if(settings.handlePositionArray){
                        splitthis               = settings.handlePositionArray.split(",");
                        settings.handlePosition = splitthis[i];
                    }

                    switch(settings.handlePosition ){
                        case "left":
                        $(this).prepend( handle );
                        break;
                        case "right":   
                        $(this).append( handle );   
                        break;
                        case "top": 
                        $("."+container+"Top").append( handle );    
                        break;
                        case "bottom":  
                        $("."+container+"Bottom").append( handle ); 
                        break;
                    }                   

                    $("#"+container+"Handle"+i).bind("mouseover", function(){
                        $("#"+container+"Handle"+i).addClass(settings.handleClassOver);
                    });

                    $("#"+container+"Handle"+i).bind("mouseout", function(){
                        if( $("#"+container+"Handle"+i).attr("rel") != "selected"){
                            $("#"+container+"Handle"+i).removeClass(settings.handleClassOver);
                        }
                    });


                    $.hrzAccordion.setOnEvent(i, container, finalWidth, settings);              

                    if(i == elementCount-1){
                        $('#'+container+",."+container).show();                 
                    }



                    if(settings.openOnLoad !== false && i == elementCount-1){
                            var location_hash = location.hash;
                            location_hash  = location_hash.replace("#", "");    
                            if(location_hash.search(settings.hashPrefix) != '-1' ){
                            var tab = 1;
                            location_hash  = location_hash.replace(settings.hashPrefix, "");
                            }

                            if(location_hash && tab ==1){
                                $("#"+container+"Handle"+(location_hash)).attr("rel",container+"HandleSelected");
                                $("#"+container+"Content"+(location_hash)).attr("rel",container+"ContainerSelected");       
                                $("#"+container+"Handle"+(location_hash-1)).trigger(settings.eventTrigger);

                            }else{
                                $("#"+container+"Handle"+(settings.openOnLoad)).attr("rel",container+"HandleSelected");
                                $("#"+container+"Content"+(settings.openOnLoad)).attr("rel",container+"ContainerSelected"); 
                                $("#"+container+"Handle"+(settings.openOnLoad-1)).trigger(settings.eventTrigger);
                            }                   
                    }   
                }); 

                if(settings.cycle === true){
                    $(this).hrzAccordionLoop();
                }
            });             
        }       
    });
})(jQuery); 

**Given is the code used for the accordion…please check out this Accordion Link. in the link there are four examples of accordions. I want the last accordion, i.e example 4, to be vertical.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:55:17+00:00Added an answer on May 27, 2026 at 12:55 am

    I think this is what you want:

    http://www.portalzine.de/Horizontal_Accordion_Plugin_2/lib/jquery.hrzAccordion.examples.js

    Edit: the JS you’ve posted is, I think, the whole plugin. Just include the plugin on your page, plus jQuery, plus the relevant snippet from my link above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

jQuery and JavaScript in general are new ground for me. What are some good
jQuery 1.4 added a shorthand way for constructing new DOM Elements and filling in
jQuery: <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js/> $(document).ready({ $(.title).click(function(){ var descID = $(this).attr(id); var newID = #+descID+d;
jQuery.fn.jquery equivalent for jQuery Mobile? To programmatically check the version of jQuery one can
jQuery(document).ready(function($) { $('#videolayer').mediaelementplayer({ defaultVideoWidth: 890, defaultVideoHeight: 400, enableAutosize: true, success: function(media) { media.addEventListener('play', function(media)
Jquery has a great language construct that looks like this: $(document).ready(function() { $(a).click(function() {
jQuery selectors are wonderful, but I sometimes I find myself typing them over and
jQuery's draggable functionality doesn't seem to work on tables (in FF3 or Safari). It's
jQuery UI Sortable + Draggable 1.6rc5 WHAT I AM DOING: Creating a calendar with
jQuery provides a browser neutral library for accessing and manipulating the DOM. This is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.