Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get Cufon to work on a button?

So right now I'm bashing my head - at the moment we use an element for a button to give it our own custom font, fine - this works, but as we're using Cufon on the rest of the site, we're wondering if it's possible to get Cufon working on a button.

So far I've changed the button to an and using standard css styles on an 'input' or 'input[type="submit"]' element work fine - but I've tried both of these in cufon to no avail.

This is a button - so as Cufon generates images, this should work, but maybe I'm doing it wrong - can anyone help?

like image 885
Tom Harvey Avatar asked Aug 22 '09 11:08

Tom Harvey


1 Answers

$('.input-button').each(function(){
    $(this).hide().after('<span class="input-button">').next('span.input-button').text($(this).val()).click(function(){
        $(this).prev('input.input-button').click();
    });
});

I used the above code to copy my inputs value into a span, which allows me to use cufon. It works great and still falls back to the 'submit' input with javascript disabled.

like image 58
Paul Welsh Avatar answered Sep 28 '22 07:09

Paul Welsh