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: 21
Joined: Fri Jan 26, 2018 4:04 pm

Javascript Events

Post by nerdtech » Thu Mar 08, 2018 7:38 pm

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: 14531
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Javascript Events

Post by Pablo » Thu Mar 08, 2018 9:17 pm

I think the problem is with the quotes:
document.getElementById('wb_azure_large').style.zIndex = '1';

pajadt
 
 
Posts: 327
Joined: Sat Mar 16, 2013 11:23 am
Location: Europe
Contact:

Re: Javascript Events

Post by pajadt » Thu Mar 08, 2018 9:34 pm

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: 21
Joined: Fri Jan 26, 2018 4:04 pm

Re: Javascript Events

Post by nerdtech » Thu Mar 08, 2018 9:34 pm

Thanks Pablo it now works.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests