I´m modifying the appearance of two drop down lists. No problems here. Everything works great. The only issue is that the addEventListener
method only works at page refresh.
How do I make this code work at page load without hitting the refresh button?
window.addEventListener('load', function ()
{
var CityCount = this.character.citynum ;
var PosX = parseInt(CityCount) * (-15);
var MyHeight = parseInt(CityCount) * 15 - 15;
var MyStyle='div#citylist {width: 150px !important; margin-top: ' + PosX + 'px !important; position: absolute !important; height: ' + MyHeight + 'px !important; overflow: auto !important; padding-left: 1px !important}';
addGlobalStyle(MyStyle);
addGlobalStyle('div#my_city_list {width: 150px !important; margin-top: 50px !important;}');
}, false)