views:

56

answers:

1

Is there a way to change the Href of a custom ribbon button? I'm tring to tie the button to a lightbox, so that the lightbox is displayed when the button is clicked.

The ID of the button is Ribbon.Documents.New.Controls.BtnUpload-Large so I tried jQuery('#Ribbon.Documents.New.Controls.BtnUpload-Large').attr('href', href), but that didn't do it.

A: 

button?? tag button, the tag button does not have the href attribute. if you're referring to tag a, try putting the class "Ribbon-DocumentsNew-Controls-BtnUpload-Large" and try this:

<div id="test"></div>

var anchor = $('a.Ribbon-DocumentsNew-Controls-BtnUpload-Large');
$('#test_change').append('<div>old href: '+$(anchor).attr('href')+'</div>');
$(anchor).attr('href', href);
$('#test_change').append('<div>new href: '+href+'</div>');
$('#test_change').append('<div>a href: '+$(anchor).attr('href')+'</div>');
andres descalzo