x.style.borderStyle = 'dotted'; doesn't work

A

alexjaquet

Hi,

I've in my web pages an affectation to this property but it's doesn't
work (same for all the others properties I'm trying to update):

here is the complete function I call on mouseover :

<script language="javascript">
function highLigth (x) {
x.style.borderWidth = '5px';
x.style.borderStyle = 'dotted';
x.style.backgroundColor ='red';
x.style.borderTop = '5px solid #BCC3F8';
x.style.borderBottom = '5px solid #BCC3F8';
}
function highLigthOut (x) {
x.style.backgroundColor = 'white';
}

</script>

and the result on my webpage :
http://avant-garde.no-ip.biz/cgi-bin/recordz.cgi?lang=FR (slow dev
server)
 
E

Evertjan.

wrote on 04 mei 2006 in comp.lang.javascript:
Hi,

I've in my web pages an affectation to this property but it's doesn't
work (same for all the others properties I'm trying to update):

Works fine here. But pleace specify what "doesn't work" means.
Give error texts and what you want it to do.

However:
here is the complete function I call on mouseover :

<script language="javascript">

function highLigth (x) {

highLight is English
x.style.borderWidth = '5px';
x.style.borderStyle = 'dotted';

Do not specify constant styles here, but use a css declaration
x.style.backgroundColor ='red';
x.style.borderTop = '5px solid #BCC3F8';
x.style.borderBottom = '5px solid #BCC3F8';
}
function highLigthOut (x) {
x.style.backgroundColor = 'white';
}

</script>

and the result on my webpage :
http://avant-garde.no-ip.biz/cgi-bin/recordz.cgi?lang=FR (slow dev
server)

Try this file:

=======================

<script type='text/javascript'>
function highLightOver(x) {
x.style.borderStyle = 'dotted';
x.style.borderColor ='red';
}
function highLightOut(x) {
x.style.borderStyle = 'dashed';
x.style.borderColor ='green';
}
</script>

<div
onmouseover='highLightOver(this)'
onmouseout='highLightOut(this)'
style='border-width:5px;width:300px;'>
xxxxxxxxxxxxxxxxxxxxx
</div>

=======================
 
R

RobG

(e-mail address removed) said on 05/05/2006 7:31 AM AEST:
Hi,

I've in my web pages an affectation to this property but it's doesn't
work (same for all the others properties I'm trying to update):

here is the complete function I call on mouseover :

<script language="javascript">

The language attribute is deprecated, type is required.

function highLigth (x) {

I would have expected "highLight", maybe you like that spelling.

x.style.borderWidth = '5px';
x.style.borderStyle = 'dotted';
x.style.backgroundColor ='red';
x.style.borderTop = '5px solid #BCC3F8';
x.style.borderBottom = '5px solid #BCC3F8';
}
function highLigthOut (x) {
x.style.backgroundColor = 'white';
}

</script>

Your issue is not the script, it may be CSS. A CSS group (like
news:comp.infosystems.www.authoring.stylesheets) can help with that.

Here is a test case based on your code that works in Firefox:

<script type="text/javascript">

function highLigth (x) {
x.style.borderWidth = '5px';
x.style.borderStyle = 'dotted';
x.style.backgroundColor ='red';
x.style.borderTop = '5px solid #BCC3F8';
x.style.borderBottom = '5px solid #BCC3F8';
}
function highLigthOut (x) {
x.style.backgroundColor = 'white';
}

</script>

<div style="width:100px; height: 100px;"
onmouseover="highLigth(this);"
onmouseout="highLigthOut(this);"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top