Is it possible to always have the complete widget showing and no button?

Perhaps customize the size of it too?

CommentFileSizeAuthor
#3 4-5-2009 1-39-44 AM.png33.53 KBmicropat

Comments

micropat’s picture

Status: Active » Closed (works as designed)

It's possible to get the drop-down menu to display all-time, but the method requires a bit of currently unsupported hacking around.

Here's a great example of this in action: http://jyoseph.com/give-whrrl-a-whrrl/#link

If you happen to do this yourself, please do share. :)

mstef’s picture

There is no widget on that page

micropat’s picture

StatusFileSize
new33.53 KB

Hmm, you should be able to see it. See the attached screenshot.

mstef’s picture

Display the widget via:

<div id="addtoany_menu_replacee"></div>

After adding the JS file at the footer, you must add:

<script type="text/javascript">
	window.a2a_onMouseOut_delay=function(){};
	addtoany_dd=document.getElementById('a2apage_dropdown');
	addtoany_bo=document.getElementById('a2apage_border');
	addtoany_mr=document.getElementById('addtoany_menu_replacee');
	addtoany_bo.style.visibility='hidden';
	addtoany_mr.parentNode.replaceChild(addtoany_dd,addtoany_mr);
	addtoany_dd.position='relative';
	addtoany_dd.style.display='block';
	a2a_hrefs();
	a2a_fluids();
</script>
asak’s picture

mikestefff: could you provide just a little more info?

I've got addtoany module installed, the js is called from the footer. 2 questions:

1. Do you mean placing in empty div "addtoany_menu_replacee" anywhere i want? with nothing in it?
2. where should this script go? can i just add it below/above the div?

thanks...

mstef’s picture

What I provided should be incorporated into the module (attn: maintainers). Trying to use this with the module active might cause some problems - just make sure you know what you are doing.

1. Yes place the empty div wherever you want the open widget. The JS fills it automatically.
2. The added script MUST come after the addtoany JS file inclusion.

mstef’s picture

I didn't notice that there was a place in the settings page to add variables.

I just tried to enter the variables in the box but they add them to the page before the main Add to Any JS file is included - not smart. That is a bug and someone should submit it if isn't picked up here..

Also, you'll most likely need to edit the module to place the div instead of the image. I'll mess around with it in a little and post anything useful.

micropat’s picture

Hey Mike, that's not a bug. The "Additional Script" box is intended for extending the drop-down menus using the AddToAny JavaScript API. To do so, the script must be placed before the external call or subsequent calls to a2a_init().

Speaking of the API, it's on the AddToAny roadmap to make this static menu an official option. For example, you will only have to place a2a_static_menu=1 in that Additional Script box to make this work.

Kudos to you for bearing with the wait and forging your own path in the meantime. Would love to see your current implementation when you get a chance. :)

asak’s picture

Hey micropat: thanks for jumping in ;)

Following Mike's help, i've tried many options. I can get this to partly work, but i'm still very confused as to what's going on.

Making this a simple checkbox would be amazing ;)

Thanks!

asak’s picture

Ok this is what i've done to get it to work with the Addtoany native block:

1. added an ID of "addtoany" to the span class on line 169 of addtoany.module
2. Added this after $closure in page.tpl:

    <script type="text/javascript">    
    window.a2a_onMouseOut_delay=function(){};
    addtoany_dd=document.getElementById('a2apage_dropdown');
    addtoany_bo=document.getElementById('a2apage_border');
    addtoany_mr=document.getElementById('addtoany');
    addtoany_bo.style.visibility='hidden';
    addtoany_mr.parentNode.replaceChild(addtoany_dd,addtoany_mr);
    addtoany_dd.position='relative';
    addtoany_dd.style.display='block';
    </script>

To change colors, and use other API functions, i found that adding them BEFORE $closure works nicely.

So basically - pretty cool thanks mike ;)