Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
149 views
in Technique[技术] by (71.8m points)

javascript - which dom element will work outside bootstrap dropdown-item to display an default image based on open dropdown?

In my menu , i have two columns, one for submenu text and other for respective images. this portion is working fine. But i want to set a default image, which will display when user will not hover on any dropdown item or out of dropdown. but i have 2-3 dropdown menu. how to identify each individually. Thanks

code[https://jsfiddle.net/shreya_js/4h7sgpdL/48/]
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I am not sure if I got your question right.

If you need a different default image for every main menu point, then append a url/image-path to the li-tag via data-src for example.

EDIT: something like this?

https://jsfiddle.net/2a3joxfz/7/

all a-tags got an rel attribute.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...