1
我是jQuery解決方案的新手,我知道很多人都在使用它,所以也許有人能夠幫助我解決這個問題。懸停在jQuery上的位置()
我想改變一個div在另一個元素的懸停位置。
這裏是我曾嘗試代碼:
<script>
$(document).ready(function(){
$(".NEWS_menu").hover(function(){$("#dropdown_NEWS").position({
my: "bottom",
at: "top",
of: ".NEWS_menu"
})});
</script>
<ul class="lithos gradient" id="menu">
<li><a class="NEWS_menu" href="/news/index.php"><span class="BIGLETTER">N</span>ouvelles</a>
<div id="dropdown_NEWS">
<a class="ARTICLES_link" href="#"><span class="BIGLETTER">A</span>rticles</a>
</div>
</li>
[...]
academiemarisa.com如果你想看到它是什麼suposed給我。
該代碼尚未上傳。我試圖讓它首先與jquery一起工作。
現在,它正在使用CSS:非常好的懸停,但出於兼容性的原因,我需要jQuery。
如果有人可以幫助我定位jQuery。
感謝
你不能使用'.position()'來改變對象的位置,它只返回當前位置。您想根據菜單位置移動菜單的圖像嗎? –
您上面給我們的示例不使用常規的jQuery position()方法,而是使用jQueryUI的position方法。 jQueryUI是jQuery的UserInterface庫,請參閱http://api.jqueryui.com/position。 爲了使用上面的snipper,你還必須包含jqueryUI。 – Stefan