Simple Machines Community Forum

General Community => Scripting Help => Aiheen aloitti: Hoochie Coochie Man - huhtikuu 30, 2008, 07:32:01 AP

Otsikko: I have style code in a .js file.. So how can i pull it out to a css file?-Solved
Kirjoitti: Hoochie Coochie Man - huhtikuu 30, 2008, 07:32:01 AP
Hi

I'm using two style file.. I mean I have two color in my forum.. (black and white)
So users have a quickchange alternative..
Like DilberMC Theme..

I can easily edit style files for each colors

But I'm stuck  :-[  Because I have .js file which includes style codes like color.. So how can i pull it out to a css file?

or

edit the .js file?


ex:
Lainaavar moduleEnter = '#FFFFFF';
var moduleLeave = '#1E1E1E';

if (IN WHITE STYLE) moduleLeave = '#E6E6E6';


Thank you..
Otsikko: Re: I have style code in a .js file.. So how can i pull it out to a css file? or..
Kirjoitti: niko - huhtikuu 30, 2008, 09:24:05 AP
So you want to change color on mouse over? You can use hover pseudo class for that


html:

<div class="test">
Test
</div>

css:

test
{
border: 1px solid green;
}

test:hover
{
border: 1px solid black;
}


And fix for IE:

http://www.vladdy.net/Demos/IEPseudoClassesFix.html
Otsikko: Re: I have style code in a .js file.. So how can i pull it out to a css file? or
Kirjoitti: Hoochie Coochie Man - huhtikuu 30, 2008, 09:49:25 AP
Thanks but that's not what I want  :-[

I'm using mootools efect. so it's not that so simple..
and the codes are these..

Lainaavar moduleEnter = '#FFFFFF';
var moduleLeave = '#1E1E1E';

if (IN WHITE STYLE) moduleLeave = '#E6E6E6';

how can i pull it out to a css file? or what should I write in red area?  :-\
Otsikko: Re: I have style code in a .js file.. So how can i pull it out to a css file? or..
Kirjoitti: Dannii - huhtikuu 30, 2008, 07:39:32 IP
What's the JS for the red?
Otsikko: Re: I have style code in a .js file.. So how can i pull it out to a css file? or
Kirjoitti: Hoochie Coochie Man - toukokuu 01, 2008, 03:10:59 AP
I don't know,
I ask you to what should I write for the red area?

I have two style file..
style.css (black one)
and
white-style.css
Otsikko: Re: I have style code in a .js file.. So how can i pull it out to a css file? or
Kirjoitti: Hoochie Coochie Man - toukokuu 01, 2008, 07:33:41 IP
Sorry Guys, just forget what I said..

I'm just looking for this code:

Lainaaecho '
<script language="javascript" type="text/javascript" src="', $settings['theme_url'], '/tool.js"></script>';
if (STYLE IS WHITE)
echo ';
<script language="javascript" type="text/javascript" src="', $settings['theme_url'], '/white-tool.js"></script>';

What should I write for red area?  :-\
Thanks..
Otsikko: Re: I have style code in a .js file.. So how can i pull it out to a css file? or..
Kirjoitti: Dannii - toukokuu 02, 2008, 09:41:23 AP
Ahh, you mean alternate style sheets?
Otsikko: Re: I have style code in a .js file.. So how can i pull it out to a css file? or
Kirjoitti: Hoochie Coochie Man - toukokuu 02, 2008, 10:15:21 AP
Let me tell you some thing..

Now..

I have two style.css file

1. style.css (black)
and
2. white-style.css (white)

I can easily change forum colors with buttons in two seconds..
Everythings fine now..

But I have a menu style, and its codes in a .js file not in a .css file..
So I couldn't change menu's color.

I have one .js file (for black color)
But I must use two .js file for each colors (black-white)

So I looking for this red area?
Lainaaecho '
<script language="javascript" type="text/javascript" src="', $settings['theme_url'], '/tool.js"></script>';
if (STYLE IS WHITE)
echo ';
<script language="javascript" type="text/javascript" src="', $settings['theme_url'], '/white-tool.js"></script>';

Thanks..




Edit: Thanks Dannii and Niko. I solved my problem.. Yağız (http://www.simplemachines.org/community/index.php?action=profile;u=102749) helped me..

And the codes I'm looking for are these....

Lainaaecho '
    <script language="javascript" type="text/javascript" src="', $settings['theme_url'], '/js/tool.js"></script>';
    if ($settings['theme_main_color'] == 'white')
    echo '
    <script language="javascript" type="text/javascript" src="', $settings['theme_url'], '/js/white-tools.js"></script>';
Otsikko: Re: I have style code in a .js file.. So how can i pull it out to a css file? or..
Kirjoitti: Dannii - toukokuu 02, 2008, 10:33:39 AP
Well, move the JS styles to CSS!
Otsikko: Re: I have style code in a .js file.. So how can i pull it out to a css file? or..
Kirjoitti: Hoochie Coochie Man - toukokuu 02, 2008, 10:37:18 AP
Lainaus käyttäjältä: Dannii - toukokuu 02, 2008, 10:33:39 AP
Well, move the JS styles to CSS!
I can't. Than the script is not working.
Anyway. I solved my problem, thanks..