Sharrre icon indicating copy to clipboard operation
Sharrre copied to clipboard

pre-load buttons on page load with counter enabled?

Open rvdb opened this issue 12 years ago • 10 comments

Hi,

Thanks for this great plugin! I'm giving it a try, and it works smoothly.

One question: when counter is enabled, is there a way to load the individual buttons on page load, instead of on mouseover of the counter button? Loading (especially the facebook button) can take a while, so IMO it could improve user experience if the buttons are loaded in the background (while still offering the counter as first 'incentive' to share a page).

(How) Can this be done?

Best,

Ron

rvdb avatar May 29 '12 09:05 rvdb

Hi, What example do you use ? This http://sharrre.com/example3.html ?

Julienh avatar May 29 '12 09:05 Julienh

Sorry, examples are indeed easier to refer to. Yep: that's the one. What I have in mind is that the individual buttons for the different social services are loaded in the background, so the user (most likely) doesn't have to wait when hovering the counter button.

Ron

rvdb avatar May 29 '12 09:05 rvdb

Without being impatient (I'm not sure if you just asked for more info or are working on it), do you think it is feasible?

rvdb avatar Jun 04 '12 09:06 rvdb

Yes, I think is possible, I will add this functionality on the next update.

ps: sorry for the late reply, I'm very busy right now :)

Julienh avatar Jun 04 '12 12:06 Julienh

Julienh - I'm looking for the same thing. Has this been built in yet and if so how do I make it work? I just want the buttons to show, no hover required. Thanks.

vsellis avatar Feb 18 '13 15:02 vsellis

Hi Julienh - I'm looking for the same thing too. Now that it's already been over 2 years since the initial question was asked, has this been built in yet and if so how do I make it work? I just want the buttons and count over each button to show without the user having to hover... Thanks.

dangswiss avatar Feb 04 '15 19:02 dangswiss

It should have been fixed with the 2.0.0 release.

smeeckaert avatar Feb 29 '16 12:02 smeeckaert

Strange, I've just checked with 2.0.1, and behaviour seems unchanged. Though I've noticed that http://sharrre.com/example3.html is still referring to an older version (http://sharrre.com/js/jquery.sharrre-1.3.4.min.js?v=3), it doesn't change if I try it with a local version that uses the latest Sharrre code.

What I had in mind is that the .buttons element would be created upon initialization of the share box; not upon mouseenter. That way, the loading of the buttons could take place invisibly in the background, and the user wouldn't have to wait until all share buttons are loaded after hovering the #shareme element.

rvdb avatar Mar 07 '16 22:03 rvdb

I will look into it.

smeeckaert avatar Mar 08 '16 07:03 smeeckaert

Wait a minute, could that be what the "render" function is for? I found an example in this fiddle:

$('#shareme').sharrre({
  ...
  render: function(api, options) {
    api.loadButtons();
  }
  ...
});

When I add this to my own code, this seems to do the trick. So it could just be a documentation issue (the documentation is very concise for the "render" property, and the loadButtons() function isn't documented at all it seems)?

rvdb avatar Mar 08 '16 11:03 rvdb