Jump to content

RE: Making MyAccount Block into a Jquery Sidebar


motion2082
 Share

Recommended Posts

Hi Motion,

 

To do it without too much hassle, maybe you can move the container of my-account in all to the sidebar.

 

In the side bar, make some empty <div ID="my_account_sidebar"></div>

 

then

 

add some javascript like this:

 

 

<script>
    $( document ).ready(function() {
        if ($('#index').length) {
            var newParent = document.getElementById('my_account_sidebar');
 
// Get the element that contains the my-account. 
// Choose:
//  If you know the ID of the container:
//            var myAccountBlock = document.getElementById('XXX');
//  or, if the container has no name, but one of the elements inside the container does:
//            var myAccountBlock = document.getElementById('XXX').parentElement;
 
            //move the whole container to be a child of the #my_account_sidebar element
            newParent.appendChild(myAccountBlock); 
        }
    });
</script>
 

 

So change the XXX with the ID of the container where the my-account info is being placed inside, or if this container <div> has no name, use one of the children that has a name and go through that element to its parent

 

If you encounter problems:

- Create the sidebar

-  add the empty <div id="my_account_sidebar"></div> inside it.

- Give me a link to your site, and I will try to find out which element should be XXX.

(Please indicate clearly which block exactly you want to move, maybe a small screenshot or so)

 

 

pascal.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More