0

I'm absolutely new to JavaScript, so I don't know quite well what I'm doing.
Does this look right (inside of HTML)? -

<script type="text/javascript" src="/path/to/si.files.js">
		window.onload=SI.Files.stylizeAll();
	</script>

And what is si.files.js? Is it a file I have to create and place into some directory?
What is supposed to be in it? Perhaps, this:

window.onload=SI.Files.stylizeAll();

belongs there?
I am really sorry for the dumb questions, but I know nothing about JavaScript.
The source of confusion is this:
http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom

The HTML and CSS parts went smoothly for me, I guess, but the whole thing doesn't work.

Thank you!

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by levsha
0

The HTML and CSS parts went smoothly for me, I guess, but the whole thing doesn't work.

Thank you!

the code tell the page to execute the function stylizeAll() which is exist in the file SI.Files.js when its loaded.

the SI.Files.js library is provided from the link that u mention. download it from there and put it in the same directory with other files you need to try your code. and I think it should work will.

Edited by mike_2000_17: Fixed formatting

0

The HTML and CSS parts went smoothly for me, I guess, but the whole thing doesn't work.

Thank you!

the code tell the page to execute the function stylizeAll() which is exist in the file SI.Files.js when its loaded.

the SI.Files.js library is provided from the link that u mention. download it from there and put it in the same directory with other files you need to try your code. and I think it should work will.

You are saying I need to download si.files.js?
How? From which address? Could you please just give me the link or somehow point me to it?

Thank you!

Edited by mike_2000_17: Fixed formatting

0

http://www.shauninman.com/archive/20...ss_and_the_dom

if you go down the page you will find

The SI.Files library and example files have been downloaded 32982 times

just download it from the link on SI.Files library

Thank you! I found it and downloaded to the directory on my computer where the HTML, CSS and PNG image are located. Still doesn't work.

Here is my CSS:

.SI-FILES-STYLIZED label.cabinet
{
    width: 119px;
    height: 47px;
    background: url(uf_btt.png) 0 0 no-repeat;

    display: block;
    overflow: hidden;
    cursor: pointer;
}

.SI-FILES-STYLIZED label.cabinet input.file
{
    position: relative;
    height: 100%;
    width: auto;
    opacity: 0;
    -moz-opacity: 0;
    filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);
}

Here is my HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Pretty Buttons</title>
<link rel="stylesheet" type="text/css" href="buttons.css" />
<script type="text/javascript" src="si.files.js">
window.onload=SI.Files.stylizeAll();
</script>


</head>
<body>

<label class="cabinet">
<input type="file" class="file" />
</label>

</body>
</html>

Maybe you'll see why it's not working?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.