Javascript Events

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
User avatar
nerdtech
 
 
Posts: 5
Joined: Fri Jan 26, 2018 4:04 pm

Javascript Events

Post by nerdtech »

Hey, I am trying to alter the z-index of an object via the javascript event onmouseover but can't get it to work... this is the code I have used:

Code: Select all

document.getElementById("wb_azure_large").style.zIndex = "1";
The "wb_azure_large" is the ID of an image... I have also tried "azure_large" which also doesn't work. In the browsers console I get the message:

Code: Select all

SyntaxError: expected expression, got '}'


What is the correct syntax to use?..

thanks.
User avatar
Pablo
 
Posts: 21574
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Javascript Events

Post by Pablo »

I think the problem is with the quotes:
document.getElementById('wb_azure_large').style.zIndex = '1';
pajadt
 
 
Posts: 304
Joined: Sat Mar 16, 2013 11:23 am
Location: Europe
Contact:

Re: Javascript Events

Post by pajadt »

Ok now have solution
Last edited by pajadt on Thu Mar 08, 2018 9:36 pm, edited 2 times in total.
User avatar
nerdtech
 
 
Posts: 5
Joined: Fri Jan 26, 2018 4:04 pm

Re: Javascript Events

Post by nerdtech »

Thanks Pablo it now works.
Post Reply