Resizing Cufon with Media Queries
Been asked to retrofit a site for smartphones that uses cufon for headings etc.
I'm using media queries to deliver the site. All works ok, but cufon won't resize, despite changes to the re开发者_开发问答levant css. Pretty sure you do it through the .js, but not a clue how to go about it.
Any ideas or pointers? Thx
Found the solution on another website. Simply add the following:
<script type="text/javascript">
jQuery(window).bind('resize', (function() {
var timer;
return function() {
clearTimeout(timer);
timer = setTimeout(function() {
Cufon.refresh();
}, 50); // possibly more than 50
};
})());
</script>
You can use Cufon.refresh in the body onResize event. To scale your entire HTML website, see this tutorial. http://www.peecho.com/blog/scalable-websites-with-css3-and-javascript.html
We use Cufon, too.
精彩评论