thehorseisbrown thehorseisbrown - 11 months ago 59
Javascript Question

appendChild not working in google maps

Why is element A invisible? It seems that appendChild() function is ignored. I can only see the B element. (element A is visible if I push it inside the controls) :(

var a = document.createElement('A'); = '50px'; = '50px'; = 'pointer'; = 'rgba(10,20,30,1.0)';

var b = document.createElement('B'); = '200px'; = '200px'; = 'rgba(230,230,230,0.6)';


Answer Source

Your problem is that you have to display both the elements on a block level

var a = document.createElement('A'); = '50px'; = '50px'; = 'pointer'; = 'rgba(10,20,30,1.0)'; = 'block'; //style block level

var b = document.createElement('B'); = '200px'; = '200px'; = 'rgba(230,230,230,0.6)'; = '1px solid black'; = 'block'; //style block level