Jump to content
  • 0

Cufon для динамически созданного блока


zhartaunik
 Share

Question

Задача: сделать <select> с измененным бэкграундом и чтобы шрифт значения селекта был подключенным извне (я подключал куфоном).

_____________________________________________________________________________________

...

<script type="text/javascript" src="js/cufon-yui.js"></script>

<script type="text/javascript" src="js/HeliosCond.font.js"></script>

<script type="text/javascript" src="js/jquery.js"></script>

<script>

$(document).ready(function(){

if (!$.browser.opera) {

// select element styling

$('select.select').each(function(){

var title = $(this).attr('title');

if( $('option:selected', this).val() != '' ) title = $('option:selected',this).text();

$(this)

.css({'z-index':10,'opacity':0,'-khtml-appearance':'none'})

.after('<span class="select">' + title + '</span>')

.change(function(){

val = $('option:selected',this).text();

$(this).next().text(val);

})

});

};

});

</script>

<script type="text/javascript">

...

Cufon.replace(".tea-shopping .select", { fontFamily: "HeliosCond" } );

</script>

...

<div class="select-block">

<select class="select">

<option value="100">100 грамм</option>

<option value="200">200 грамм</option>

<option value="300">300 грамм</option>

</select>

</div>

__________________________________________________________________________________

Получается

<div class="select-block">

<select class="select" style="z-index: 10; opacity: 0; ">

<option value="100">100 грамм</option>

<option value="200">200 грамм</option>

<option value="300">300 грамм</option>

</select><span class="select">100 грамм</span>

</div>

___________________________________________________________________________________

Проблема:

Для

<span class="select">100 грамм</span>

не меняется с помощью Cufon.replace шрифт.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy