Hello and welcome to the Webmasters Forums!. This is the best place to get webmasters resources for free. Get $2 for free today, read more - Make your payment today. Download premium and professional templates for free. Get free web hosting without ads, read more. You can get lot more by simply join with this forum. To gain full access to the forums you must sign up for a free account.


Post Reply  Post Thread 

Calling a JavaScript function in css stylesheet

Post Bank
Posting Manager
******

Posts: 995
Group: Forum Team
Joined: Sep 2006
Status: Online
Make money from now. You can make money just for posting on this forum. Every discussions on this community gives you more money. $2 minimum payout. So get your payment today, SignIn with this forum.

Signin to Remove this Post

jimmy
Newbie


Posts: 21
Group: Registered
Joined: Sep 2007
Status: Offline
Reputation: 0
Points: 75 (Donate)
Post: #1

Calling a JavaScript function in css stylesheet


On my blog, jimmyinc.com, I am making a mod that displays a random banner at the top, a JavaScript function called randImg().


To get that to work in the css stylesheet, what do I need to do?


Here is the css code that I currently have:

Code:
/***********************************************
*    HEADER
***********************************************/
.subheader{
    height: 115px; /*185*/
    background: randImg() no-repeat;
    padding: 70px 0 0 0;
    text-align: center;
    }
.subheader h1{
    font-size: 25pt;
    color: #ffffff;
    }

That currently doesn't work.


The JavaScript part is already done, I have figured it out.


"I am Jimmy, and I approve this message"
-Myself, 2007

My blog:
http://www.jimmyinc.com

This post was last modified: 17-09-2007 10:44 AM by jimmy.

17-09-2007 10:44 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ivenms
Administrator
*******


Posts: 2,172
Group: Administrators
Joined: Sep 2006
Status: Offline
Reputation: 14
Points: 4373 (Donate)
Post: #2

RE: Calling a JavaScript function in css stylesheet


You can put JavaScript on CSS. But it will not support all the servers. IE 5.5+ will support.
That is a bad technique.

Read the threads:

http://webmasters-forums.com/I-would-lik...t-675.html

and

http://webmasters-forums.com/The-JavaScr...t-654.html

All on there to make a random image or text on JavaScript.

If you need more help, reply here.. Smile


Read: General Rules & Policies before posting.
Make Money By Posting | Earning and Exchanging Points | Add Your Links
17-09-2007 05:03 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Sad PROMPT NAME ON START(javascript),IN A HTML PAGE. Plz help,its not working 4me! Lord_Daksh 8 295 22-09-2007 05:39 AM
Last Post: Lord_Daksh

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites
Rate This Thread:

Forum Jump:

Sign In to Remove Ads

Download 1000's of web templates. Unlimited access!
World's Best Web Hosting
Website of the Month

Create-a-Page for Free
SOTM June 2008


Accepting Submissions
for July 2008
Resources

Recommended Sites:



Visit our Sponsors!

Current time: 20-08-2008, 06:15 PM


Copyright © 2002-2008 MyBB Group
Powered By MyBB