java script in css (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


artpics -> java script in css (7/10/2004 15:29:10)

hello i have just read that you can put all the java scrips(right hand click disable) in the css file.

do i just add the java script to the body part of the css where i have the coloured scroll bars or do i make up a different tag/

thankyou




jaybee -> RE: java script in css (7/10/2004 16:34:54)

Eh? Where did you read that?

Normally you put your css in one external file and your javascript in another and call both of them in.




artpics -> RE: java script in css (7/10/2004 17:10:13)

thanks jaybee i have been looking for the original post but cannot find it so this cannot be done.

u said another file please elaborate do you mean another css file to handle the java script[:D]




Giomanach -> RE: java script in css (7/11/2004 0:17:05)

To define more. CSS and JavaScript are two completely different langauges. CSS formats, JavaScipt alters the browsers behaviour.

To link to CSS and/or JavaScript you wil need either fo the follwing for external JavaScript files or Stylesheets:


Stylesheet:

<link rel="stylesheet" ty[e="text/css" href="01.css">

-or-

<style type="text/css">
@import: url('01.css');
</style>

And for JavaScript:

<script src="scripts.js" language="JavaScript" type="text/JavaScript"></script>

Put them in the same file and you will have hell on earth on your web pages[:D]

Dan




artpics -> RE: java script in css (7/11/2004 0:25:40)

quote:

<script src="scripts.js" language="JavaScript" type="text/JavaScript"></script>
so dan if i call the script what sort of file do i make a html file ??

so would it look like this
<script src="http://www.mysite.net/scriptfolder/????.js" language="JavaScript" type="text/JavaScript"></script>

or i have i completely lost it lol [:D]

since i have used my css the pages are so much better but would like to get rid of the java script off the source code on the main page

thanks
RT




Giomanach -> RE: java script in css (7/11/2004 0:29:26)

ROFL

Do you know how to write JS? If not toddle over to http://www.w3schools.com and learn how to do so.

You only need to use the abslute reference if using includes or it's on an external server to your web, but the rest is how it should be.

SHow me a lnk to the pages, and I'll see how much of a mess they are[:)]

Dan




artpics -> RE: java script in css (7/11/2004 0:43:07)

thought you would like that dan lol


or see the site in *site critiques*

it is a right hand click script, which i want to call from a outside folder like u said
*sun coming up in the UK*

thanks RT




Giomanach -> RE: java script in css (7/11/2004 0:47:50)

It's not too bad on JS at the mo, but I say any more and your asking for a slap[:D][;)]

Would you like me to implement, or are you brave enough to give it a shot?

And from one Brit to another - The title in FF is all wonky, were you drunk?[:D][8D][;)]




Giomanach -> RE: java script in css (7/11/2004 0:48:29)

Oh yeah, your image rollovers can be done with CSS, and CSS layouts




artpics -> RE: java script in css (7/11/2004 0:53:18)

<html>
<head>
</head>
<body>

<script src="xxx.js">
</script>


</body>
</html>
this is what i found at school thanks

this is what i am using at the moment pasted in the body tags


<script language="JavaScript">

<!--
// No rightclick script.
// Find more great scripts and applets at the JavaFile!
// http://www.javafile.com
// Do not delete this header!

var message="All images text copyright- www.artpictures.tv!."; // Put your message for the alert box between the quotes.

// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->
</script>




Giomanach -> RE: java script in css (7/11/2004 0:55:59)

Won't stop me gettig your images[:)]

With scripts like that, the only way to implement it is to have it in every HTML file there is. Is the site FPSE/ASP/PHP reliant? or just HTML/CSS/JS?




artpics -> RE: java script in css (7/11/2004 1:03:55)

html css -no database etc

not a problem it is just that i put the coloured scroller bar in the css
to clean the page up would like to do this with this java script

thanks dan

i have seen the .js scrips when i use page transitions in fp , i spose these are different hence the.js ext


okay i see the .js extension on my counter which goes to a website with my account no 112333747575??.js
so at least i learnt some thing

thanks again




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
9.765625E-02