How do you swap DIVs on mouseover (jQuery)?

后端 未结 5 1132
天涯浪人
天涯浪人 2020-12-03 14:05

This most be the second most simple rollover effect, still I don\'t find any simple solution.

Wanted: I have a list of items and a corresponding lis

5条回答
  •  清歌不尽
    2020-12-03 14:29

    Here's my light-markup jQuery version:

    
    
    
    • First slide
    • Second slide
    • Third slide
    • Fourth slide
    Well well.
    Oh no!
    You again?
    I'm gone!

    This has the advantage of showing all the slides if the user has javascript turned off, uses very little HTML markup and the javascript is pretty readable. The switchTo function takes an index number of which

  • /
    pair to activate, resets all the relevant elements to their default styles (non-bold for list items, display:none for the DIVs) and the sets the desired list-item and div to bold and display. As long as the client has javascript enabled, the functionality will be exactly the same as your original example.

提交回复
热议问题