Не срабатывает функция.
Сижу уже второй час.
Вызов функции не происходит и все. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <script type="text/javascript" src="jquery-1.7.1.min.js"></script> <script> //--------square----------- $('#square').mouseover(function() { alert("Hello_world"); }); </script> </head> <body> <div id="cont"> <img id="square" src="square.png" alt="" /> </div> </body> </html> |
Цитата:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <script> //--------square----------- $(document).ready(function() { $('#square').mouseover(function() { alert("Hello_world"); }); }); </script> </head> <body> <div id="cont"> <img id="square" src="http://javascript.ru/forum/images/smilies/smile.gif" alt="" /> </div> </body> </html> |
Вот что значит на jq долго не писать. Забыл про эту особенность.
|
lancer, эта "особеннось" работает вообще везде! :D Если событие не присвоено элементу - таки оно и не сработает...
|
я про $(document).ready )
|
Цитата:
Но я про то, что и на чистом JS (да и любом другом языке) без правильного навешивания события ничего происходить не будет... |
Часовой пояс GMT +3, время: 14:51. |