jquery - Hovering over item in WordPress list of pages shows Featured Image -
client requesting functionality allow wordpress generate list of child pages, , when item (text) list hovered, featured image show. here's example of such functionality.
upon further research, found this thread. however, upon review seems though petley jones website has hardcoded page links. incorrect. needing wp_list_pages or perhaps get_page used since there many child pages added staff , not 1 person.
i aware of solutions using both jquery , css. jquery solution seems best this, not sure how go coupling wordpress. css require each item have same class or id, can implement, not sure how call unique page ids within stylesheet. advice appreciated!
you may try follow following procedure-
- when fetch child pages wrap div class name
<div class="child_page"></div>
, inside place child page's name's php code. - inside div below child page's code add div class
<div class="child_page_img"></div>
, inside place code grab feature image of specific page. - add css in theme's stylesheet-
.child_page_img{display:none;} .child_page:hover .child_page_img{display:block;}
- since ie6 doesn't allow hovering on element except
a
element, can placechild_page_img
div ina
element of child pages permalink.
this trick should work. thanks
Comments
Post a Comment