navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

java script in css

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> java script in css
Page: [1]
 
artpics

 

Posts: 122
Joined: 12/20/2003
From: London UK
Status: offline

 
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

 

Posts: 14175
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
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.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to artpics)
artpics

 

Posts: 122
Joined: 12/20/2003
From: London UK
Status: offline

 
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:)

(in reply to jaybee)
Giomanach

 

Posts: 6113
Joined: 11/19/2003
From: England
Status: offline

 
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:)

Dan

_____________________________




(in reply to artpics)
artpics

 

Posts: 122
Joined: 12/20/2003
From: London UK
Status: offline

 
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 :)

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

(in reply to Giomanach)
Giomanach

 

Posts: 6113
Joined: 11/19/2003
From: England
Status: offline

 
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

_____________________________




(in reply to artpics)
artpics

 

Posts: 122
Joined: 12/20/2003
From: London UK
Status: offline

 
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

< Message edited by artpics -- 7/29/2004 13:25:01 >

(in reply to Giomanach)
Giomanach

 

Posts: 6113
Joined: 11/19/2003
From: England
Status: offline

 
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:):)

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?:):):)

_____________________________




(in reply to artpics)
Giomanach

 

Posts: 6113
Joined: 11/19/2003
From: England
Status: offline

 
RE: java script in css - 7/11/2004 0:48:29   
Oh yeah, your image rollovers can be done with CSS, and CSS layouts

_____________________________




(in reply to Giomanach)
artpics

 

Posts: 122
Joined: 12/20/2003
From: London UK
Status: offline

 
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>

(in reply to artpics)
Giomanach

 

Posts: 6113
Joined: 11/19/2003
From: England
Status: offline

 
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?

_____________________________




(in reply to artpics)
artpics

 

Posts: 122
Joined: 12/20/2003
From: London UK
Status: offline

 
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

< Message edited by artpics -- 7/11/2004 1:13:47 >

(in reply to Giomanach)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> java script in css
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts