Solved

Javascript streamlining and condensing

Posted on 2013-05-20
1
251 Views
Last Modified: 2013-05-21
Is there a way to streamline and/or condense the following Javascript?

<script type="text/javascript">  
    Cufon.replace('.fugu-lrg', { fontFamily: 'Fugu' });
    Cufon.replace('.fugu-xl', { fontFamily: 'Fugu' });
    Cufon.replace('.fugu-med', { fontFamily: 'Fugu' });
    Cufon.replace('.fugu-lrg-white', { fontFamily: 'Fugu' });
	Cufon.replace('.gotham-lrg', { fontFamily: 'Gotham Book' });
	Cufon.replace('.gotham-med-lrg', { fontFamily: 'Gotham Book' });
	Cufon.replace('.gotham-med', { fontFamily: 'Gotham Book' });
	Cufon.replace('.index-title', { fontFamily: 'Gotham Book' });
	Cufon.replace('.gotham-grey', { fontFamily: 'Gotham Book' });
	Cufon.replace('.sales-title', { fontFamily: 'Gotham Book' });
	Cufon.replace('.sales-content', { fontFamily: 'Gotham Book' });
	Cufon.replace('.sale-action-left', { fontFamily: 'Gotham Bold' });
	Cufon.replace('.sale-action-right', { fontFamily: 'Gotham Book' });			
</script>

Open in new window

0
Comment
Question by:rgranlund
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 39183944
Hi,
if you use jQuery / load jQuery before then you should be able to use:
<script type="text/javascript">  
    Cufon.replace('.fugu-lrg,.fugu-xl,.fugu-med,.fugu-lrg-white', { fontFamily: 'Fugu' });
	Cufon.replace('.gotham-lrg,.gotham-med-lrg,.gotham-med,.index-title,.gotham-grey,.sales-title,.sales-content,.sale-action-right', { fontFamily: 'Gotham Book' });
	Cufon.replace('.sale-action-left', { fontFamily: 'Gotham Bold' });
</script>

Open in new window

HTH
Rainer
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to dynamically set the form action using jQuery.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question