Click here to Skip to main content
15,885,782 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: help me please Pin
Leon Munir25-Nov-12 13:46
Leon Munir25-Nov-12 13:46 
GeneralRe: help me please Pin
J4amieC25-Nov-12 21:13
J4amieC25-Nov-12 21:13 
GeneralRe: help me please Pin
Leon Munir26-Nov-12 2:06
Leon Munir26-Nov-12 2:06 
GeneralRe: help me please Pin
J4amieC26-Nov-12 5:30
J4amieC26-Nov-12 5:30 
GeneralRe: help me please Pin
fjdiewornncalwe26-Nov-12 5:37
professionalfjdiewornncalwe26-Nov-12 5:37 
GeneralRe: help me please Pin
nth9226-Nov-12 9:28
nth9226-Nov-12 9:28 
Questiononmouseover and document.getElementById Pin
SRJ9223-Nov-12 4:18
SRJ9223-Nov-12 4:18 
AnswerRe: onmouseover and document.getElementById Pin
J4amieC23-Nov-12 4:48
J4amieC23-Nov-12 4:48 
An HTML page is interpreted top to bottom. When your javascript runs (in the head) the HTML has not yet been parsed, and therefore does not exist.

Put everythng into a function

JavaScript
function runMeOnLoad(){
    var galleryImg = document.getElementById('image');
    var bar = document.getElementById('imgBar');
			
    galleryImg.onmouseover = function ()
    {
        bar.style.display = "block";
    };
    galleryImg.onmouseout = function ()
    {
        bar.style.display = "none";
    };
}


And execute onload

HTML
<body onload="runMeOnLoad()">

GeneralRe: onmouseover and document.getElementById Pin
SRJ9223-Nov-12 5:49
SRJ9223-Nov-12 5:49 
AnswerRe: onmouseover and document.getElementById Pin
sachin_jain30-Nov-12 9:17
sachin_jain30-Nov-12 9:17 
Questiondisplaying different contentunder single layout Pin
radha123 from Hyderabad23-Nov-12 3:32
radha123 from Hyderabad23-Nov-12 3:32 
AnswerRe: displaying different contentunder single layout Pin
manojwadnere28-Dec-12 0:07
manojwadnere28-Dec-12 0:07 
QuestionRegular expression Pin
Member 962181822-Nov-12 2:25
Member 962181822-Nov-12 2:25 
AnswerRe: Regular expression Pin
n.podbielski22-Nov-12 20:00
n.podbielski22-Nov-12 20:00 
GeneralRe: Regular expression Pin
Manfred Rudolf Bihy22-Nov-12 21:20
professionalManfred Rudolf Bihy22-Nov-12 21:20 
GeneralRe: Regular expression Pin
n.podbielski23-Nov-12 21:15
n.podbielski23-Nov-12 21:15 
Questionform validation Pin
therainking7821-Nov-12 22:07
therainking7821-Nov-12 22:07 
AnswerRe: form validation Pin
Richard MacCutchan21-Nov-12 22:17
mveRichard MacCutchan21-Nov-12 22:17 
GeneralRe: form validation Pin
therainking7828-Nov-12 13:14
therainking7828-Nov-12 13:14 
AnswerRe: form validation Pin
bVagadishnu28-Nov-12 11:14
bVagadishnu28-Nov-12 11:14 
GeneralRe: form validation Pin
therainking7828-Nov-12 13:17
therainking7828-Nov-12 13:17 
Questionopeing a new window in JS after time interval Pin
WaqasCheema20-Nov-12 23:36
WaqasCheema20-Nov-12 23:36 
AnswerRe: opeing a new window in JS after time interval Pin
AnalogNerd30-Nov-12 4:51
AnalogNerd30-Nov-12 4:51 
QuestionDraw circuit diagram using javascript Pin
anishkannan18-Nov-12 22:31
anishkannan18-Nov-12 22:31 
AnswerRe: Draw circuit diagram using javascript Pin
n.podbielski19-Nov-12 21:07
n.podbielski19-Nov-12 21:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.