Войти

Показать полную графическую версию : JS - style.background


Ginger
08-12-2003, 16:44
в поиске подобной темы не нашла

пишу функцию:

function arr()
{
document.getElementById('me').style.background-image="img/arr.gif";
document.getElementById('me').style.background-repeat="no-repeat";
document.getElementById('me').style.background-position="right";
}
function arr_ov()
{
document.getElementById('me').style.background-image="img/arr-ov.gif";
document.getElementById('me').style.background-repeat="no-repeat";
document.getElementById('me').style.background-position="right";
}


в бодях:
<div class="m" id="me" onMouseOver="arr_ov()" onMouseOut="arr()"><a href="#">bla</a></div>

говорит на этой линии, где <div> в char 1: object expected.
а на линии - document.getElementById('me').style.background-image="img/arr.gif";
синтаксическая ошибка... что-то я смотрела и не вижу..

что-то не пойму... - он либо не умеет рисовать style.background-... , или я не понимаю, что ему надо...

Исправлено: Ginger, 17:47 8-12-2003

Agent Comanche
09-12-2003, 02:33
Правильно так - backgroundImage, backgroundRepeat...

Ginger
09-12-2003, 02:50
Agent Comanche
ок
спасиб.
я правда решила эту проблему простым css...

и
onMouseOver="this.className='klas'"




© OSzone.net 2001-2012