javascript - Jquery - Google Font Select with Font Size, Weight, Style -


i trying customize 1 of functions have selecting google font , updating preview div, want add "font size", "font weight", "letter spacing" etc, function works when click on main font selecter combox box, want check other options font weight, size, letter spacing , update preview, tried adding jquery code indivudally each element them cannot value id of main select box.. can please me make this, or atleast work on 1 option have added, rest myself.. please take @ fiddle 0 when comes jquery..

//init when value changed jquery( '.google_font_select' ).change(function(){      var mainid = jquery(this).attr('id');     googlefontselect( this, mainid ); }); 

http://jsfiddle.net/3ewmj/

take @ these lines in code:

var _selected = $(slctr).val(); ... $('.'+ _previewer ).css('font-family', _selected +', sans-serif' ); 

what going copy code in order change other attributes of text. these lines of code define html element holds options , change value of font-family css property. basically, need same thing, other properties.

using font-weight property example, let's assign variable drop-down menu font-weight:

var font_weight = $('#gfont_weight').val(); 

then use variable font weight , assign so:

$('.'+ _previewer ).css('font-weight', font_weight); 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -