Цитата:
$("#1").hover(
|
не работает... пробовал id тега <a> и <div>
<script>
$(window).load(function(){
$("#1").hover(
function (this) {
$(this).stop().animate({
'left': '465px',
'top': '422px'
}, 800);
},
function () {
$(this).stop().animate({
'left': '465px',
'top': '422px'
}, 800);
}
);
});
</script>
</div>
<div id="1"> <a href="#" style="position:absolute; overflow:hidden; left:465px; top:922px; width:180px; height:255px; z-index:0"><img src="images/1.png"></a></div>
|
Естественно не работает! И не должно работать. Вы присваиваете position absolute для ссылки, а двигать пытаетесь див.
|
Цитата:
$("#1 a")
|
Смотрите, я с дива убрал id и поставил его тегу <a>, не работает.
Потом вернул все обратно и написал $("#1 a"), но тоже не работает!.. Вот весь код:
<script>
$(window).load(function(){
$("#1 a").hover(
function (this) {
$(this).stop().animate({
'left': '465px',
'top': '422px'
}, 800);
},
function () {
$(this).stop().animate({
'left': '465px',
'top': '422px'
}, 800);
}
);
});
</script>
</div>
<div id="1"> <a href="#" style="position:absolute; overflow:hidden; left:465px; top:922px; width:180px; height:255px; z-index:0"><img src="images/1.png"></a></div>
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<div id='1'>
<a href='#' style='width: 60px; height: 20px; position: absolute; top: 0; left: 0'>aaa</a>
</div>
<div>
<a id='2' href='#' style='width: 60px; height: 20px; position: absolute; top: 0; left: 100px'>aaa</a>
</div>
<script>
$(window).load(function(){
$('#1 a').hover(
function () {
$(this).stop().animate({
'left': '50px',
'top': '20px'
}, 300);
},
function () {
$(this).stop().animate({
'left': '0px',
'top': '0px'
}, 300);
}
);
$('#2').hover(
function () {
$(this).stop().animate({
'left': '50px',
'top': '20px'
}, 300);
},
function () {
$(this).stop().animate({
'left': '100px',
'top': '0px'
}, 300);
}
);
});
</script>
|
мне кажется или он не работает?) текст не движется
|
во, заработало) все, спасибо огромное)) буду разбираться
|
Что выдает консоль? Вы вообще подключили jQuery?
|
все, работает, jQuery конечно же подключил, ответы на все мои вопросы получил =) спасибо Вам
|
| Часовой пояс GMT +3, время: 22:27. |