Re: [問題] 關於這個東西:#mainContainer img[title]
※ 引述《allen880808 (Allen)》之銘言:
: 抱歉 因為還是有點問題所以自己回自己的文
: 如果有需要的話我可以把前一篇刪除
: 其實那段完整的語法如下:
: $("#mainContainer img[title]").tooltip({
: offset: [10, 2],
: effect: 'slide'
: // add mainContainermic plugin with optional configuration for bottom edge
: }).mainContainermic({ bottom: { direction: 'down', bounce: true } });
: }
: 翻譯成人話應該是"mainContainer(id)裡有title的圖片全都套用以下設定(offset..略)
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: 除此之外 有title的圖片則套用以下設定(bottom...略)"
: 而我的問題是 我希望把它改成"只有id為aaa跟bbb的套用以下設定(offset..略)
: ^^^^^^^^^^^^^^^^
: 除此之外 有title的圖片則套用以下設定(bottom...略)"
: 請問該如何修改呢? 希望各位能不吝賜教 謝謝
以程式碼來說的話,你所描述的需求會是
var all_img= $("#mainContainer img[title]");
var spec_img = $("#aaa,#bbb");
all_img.not(spec_img).mainContainermic(
{ bottom: { direction: 'down', bounce: true } });
spec_img.tooltip({
offset: [10, 2],
effect: 'slide'
});
tooltip跟mainContainermic其實是完全獨立的,
會寫在一起只是應用了 method chain 的魔幻技巧。
(可 google "method chain" 查看更多訊息)
--
我:一半的日子讓你說,我聽你說你的所有______________________________________
______________________________________一半的日子我想說,對你說過去的所有:我
_______________________________________________________
在討論中妥善扮演兼具聆聽與分享的角色,是我們一生的課題。
_______________________________________________________
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.70.170.11
推
06/28 12:56, , 1F
06/28 12:56, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 3 篇):
Web_Design 近期熱門文章
PTT數位生活區 即時熱門文章
15
23